A
Alfonso Morra
I have a class declared as ff:
class __declspec(dllexport) A {
public:
A() ;
A(const A&)
A& operator=(const A&) ;
~A() ;
void doThis(void) ;
void doThat(void) ;
private:
std::string s ;
std::vector< <std:air> > vp ;
......
};
When I compile the code, the compiler generates several warnings such as:
warning C4251: 'A::s' : class 'std::basic_string<_Elem,_Traits,_Ax>'
needs to have dll-interface to be used by clients of class 'A'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
etc. Why do I have to export private variables (is that what the warning
message is instructing me to do?)
Despite the warnings, the code builds and the dll is built. When I use
the dll in another project, problems (unsuprisingly) arise but they are
of a slightly different kind. One of the class methods is anoverloaded
function template method. This does not seem to be exported and I am
getting a link error when I try to link to A.lib so I can create a
project that uses classes exported by A.dll
Any pointers will be appreciated. Tks
class __declspec(dllexport) A {
public:
A() ;
A(const A&)
A& operator=(const A&) ;
~A() ;
void doThis(void) ;
void doThat(void) ;
private:
std::string s ;
std::vector< <std:air> > vp ;
......
};
When I compile the code, the compiler generates several warnings such as:
warning C4251: 'A::s' : class 'std::basic_string<_Elem,_Traits,_Ax>'
needs to have dll-interface to be used by clients of class 'A'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
etc. Why do I have to export private variables (is that what the warning
message is instructing me to do?)
Despite the warnings, the code builds and the dll is built. When I use
the dll in another project, problems (unsuprisingly) arise but they are
of a slightly different kind. One of the class methods is anoverloaded
function template method. This does not seem to be exported and I am
getting a link error when I try to link to A.lib so I can create a
project that uses classes exported by A.dll
Any pointers will be appreciated. Tks