I have a strange linking problem with VisualStudio 2008:
I have a C++ DLL containing a basic class.
It contains two other classes A and B. Both A and B are
constructed with "new" in the MyClass constructor.
This looks like:
#ifdef MyClass_EXPORTS
#define MyClass_API __declspec(dllexport)
#else
#define MyClass_API __declspec(dllimport)
#endif
class MyClass_API MyClass
{
...
class A_DEF* A ;
class B_DEF* B ;
...
}
I use this DLL in an other C++ project, which is a console
application.
int __cdecl main( int argc, char *argv[] )
{
MyClassDEF* MyClass
MyClass = new MyClassDEF() ;
....
MyClass->A->Function1() ;
MyClass->B->Function2() ;
....
}
What I am struggling with is: B->Funktion2() is not found by the
linker which creates a
LNK2019 error message: "Unresolved external symbol"
At the same time, A->Funktion1() is linked without problem.
I can see no conseptual difference between class A ad B though.
B->Function2() is defined and declared and the compiler has no
problem
with B.
Also, ALL public member variables of B are available, but NONE of its
member functions.
Does anybody have an idea what I am doing wrong?
Thanks in advance, best regards
Peter