Question

trying to wrap a native cpp class using managed c++ class.

all looks good but for some reason it wont compile.

getting the following linker errors:

Error 25 error LNK2028: unresolved token (0A0002CE) Error 27 error LNK2019: unresolved external symbol

Any ideas how do I fix this one ? :\

well, here is a full error of one of the functions:

Error 20 error LNK2028: unresolved token (0A0002CF) "public: bool __thiscall RCSclient::ResumeChannel(char *,int,__int64)" (?ResumeChannel@RCSclient@@$$FQAE_NPADH_J@Z) referenced in function "public: bool __clrcall RCSClientWrapper::RCSclientWrapper::ResumeChannel(class System::String ^,int,class System::DateTime ^)" (?ResumeChannel@RCSclientWrapper@RCSClientWrapper@@$$FQ$AAM_NP$AAVString@System@@HP$AAVDateTime@4@@Z) RCSClientWrapper.obj RCSClientWrapper

Tried to add the user32.lib with no results..

Ofer

Was it helpful?

Solution

C++/CLI allows you to mix in native C++ pretty much at will, but using C++/CLI makes your app depend on the .NET framework.

The reason is your C++/CLI project doesn't have some libs (user32.lib, in example) setup in the linker input is that the .NET framework already provides similar services, and the IDE assumes that you prefer those to the older, native ones.

Check your project and add reference to the corresponding library.

OTHER TIPS

Maybe you forgot an virtual keyword into the native C++ header function declaration to call from managed wrapper!?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top