Problem exporting class with stl member

T

Tom

Hi everyone!

I get a warning (C4251) if I exports a class which has an stl data-type as
member (in my case a std::map<std::string, std::map<std::string,
std::string> >).

I know what the problem is (std::map must have an export declaration) but I
hope anybody can give me a piece of advice how I can resolve this problem.

Thanks in advance
Tom


Compiler Warning (level 1) C4251:
'identifier' : class 'type' needs to have dll-interface to be used by
clients of class 'type2'
 
V

Victor Bazarov

Tom said:
I get a warning (C4251) if I exports a class which has an stl data-type as
member (in my case a std::map<std::string, std::map<std::string,
std::string> >).

I know what the problem is (std::map must have an export declaration) but I
hope anybody can give me a piece of advice how I can resolve this problem.

Thanks in advance
Tom


Compiler Warning (level 1) C4251:
'identifier' : class 'type' needs to have dll-interface to be used by
clients of class 'type2'

I think it's cured by an explicit specialisation of the template
that you need. However, it's been awhile since I did that. You
should ask in a newsgroup where "dll-interface" is something that
the people recognise (Standard C++ knows nothing about DLLs). I
recommend "microsoft.public.vc.language".

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,164
Messages
2,570,899
Members
47,441
Latest member
OscarSchle

Latest Threads

Top