By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,332 Members | 1,404 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,332 IT Pros & Developers. It's quick & easy.

Problem exporting class with stl member

P: n/a
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'
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Tom" <no****@yahoo.com> wrote...
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
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.