Despite the following messages about using and linking to unmanaged C ++ code from a dll of a C ++ / CLI shell, I cannot solve these link problems.
1>MyClassAdapter.obj : error LNK2028: unresolved token (0A00000A) "public: __thiscall MyClass::~MyClass(void)" ( ??1MyClass@ @ $$FQAE@XZ ) referenced in function "public: void * __thiscall MyClass::`scalar deleting destructor'(unsigned int)" ( ??_GMyClass@ @ $$FQAEPAXI@Z ) 1>MyClassAdapter.obj : error LNK2028: unresolved token (0A00000B) "public: __thiscall MyClass::MyClass(void)" ( ??0MyClass@ @ $$FQAE@XZ ) referenced in function "public: __clrcall WrapperLayer::MyClassAdaptor::MyClassAdaptor(void)" ( ??0MyClassAdaptor@WrapperLayer @@ $$FQ$AAM@XZ ) 1>MyClassAdapter.obj : error LNK2019: unresolved external symbol "public: __thiscall MyClass::MyClass(void)" ( ??0MyClass@ @ $$FQAE@XZ ) referenced in function "public: __clrcall WrapperLayer::MyClassAdaptor::MyClassAdaptor(void)" ( ??0MyClassAdaptor@WrapperLayer @@ $$FQ$AAM@XZ ) 1>MyClassAdapter.obj : error LNK2019: unresolved external symbol "public: __thiscall MyClass::~MyClass(void)" ( ??1MyClass@ @ $$FQAE@XZ ) referenced in function "public: void * __thiscall MyClass::`scalar deleting destructor'(unsigned int)" ( ??_GMyClass@ @ $$FQAEPAXI@Z )
I have an unmanaged native C ++ dll with a simple class exporting / importing characters respectively
// MyClass.h
And I can see the DLL and the .lib linker file created after the build.
Then I have a managed C ++ / CLI shell project (also a DLL) that references MyClass.lib in the setting Linker-> Input-> Additional Dependencies. Also included is the .h file from MyClass in the shell project, and I see that sln can see the MyClass.h file.
// MyClassAdaptor.h
What could be missing?
source share