warning C4251: 'cString::TxtString' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'cString'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
And when I put it outside the class ... no error. What am I doing wrong? MSDN says that I need a dll export interface or something ???
std::string
I am using std::string in a class. When I compile the compiler gives me this warning ...
I'm a bit confused to.
but
but
__declspec(dllexport)
is the dll export stringvoid __declspec(dllexport) foo()
This issue is due to the STL templates classes.
Generally you can safely ignore this warning. It will always occur if you use STL clases as parameter or output in your public class interface while linking the static lib version of the C/C++ runtime. Changing the project settings to Multi(or Single)-Threaded DLL might help with that.
Hope this helps (and is somewhat technically correct - it's 4am at my place [wink]),
Pat
Generally you can safely ignore this warning. It will always occur if you use STL clases as parameter or output in your public class interface while linking the static lib version of the C/C++ runtime. Changing the project settings to Multi(or Single)-Threaded DLL might help with that.
Hope this helps (and is somewhat technically correct - it's 4am at my place [wink]),
Pat
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement