problem with dll
-
In a dll, I define a class in the following way:
class _declspec(dllexport) jalla { std::list m_mesh; };
but when I try to compile it, I get the warning:e:\Work\C++\Project\3DGame\3DSLoader.h(19) : warning C4251: 'jalla::m_mesh' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'jalla' with [ _Ty=int ]
what is happening? øivind -
In a dll, I define a class in the following way:
class _declspec(dllexport) jalla { std::list m_mesh; };
but when I try to compile it, I get the warning:e:\Work\C++\Project\3DGame\3DSLoader.h(19) : warning C4251: 'jalla::m_mesh' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'jalla' with [ _Ty=int ]
what is happening? øivind -
the class is like this: class _declspec(dllexport) jalla { std::list<int> m_mesh; }; øivind
It means that the instance
std::list<int>
needs to have adllexport
attribute on it in order to be safely usable by clients. Just like you are taggingjalla
withdllexport
. As you may understand, exposing STL datatypes through a DLL interface is not easy. I don't know any good workarounds for it, other than using a non templated and exportable type/class. Sorry. :( -- Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr. Welle: Erdball - F104-G Starfighter