D
Dave Burns
I have the following situation:
There are two dlls in question: a c++ dll (native) and a c++/cli dll
(managed) with /clr option enabled.
Managed dll links with native dll.
Native dll exports a class ClientSession with a method GetJob.
Managed dll references this method and compiles just fine.
Managed dll does NOT link however and gives this error:
error LNK2028: unresolved token (0A000168) "public: class
Rimage::Simple::Api::Job * __thiscall
Rimage::Simple::Api::ClientSession::GetJobW(wchar_t const *)"
(?GetJobW@ClientSession@Api@Simple@Rimage@@$$FQAEPAVJob@234@PB_W@Z)
referenced in function "public: class Rimage::Simple:otnet::Api::Job ^
__clrcall Rimage::Simple:otnet::Api::ClientSession::GetJobW(class
System::String ^)"
(?GetJobW@ClientSession@Api@Dotnet@Simple@Rimage@@$$FQ$AAMP$AAVJob@2345@P$AAVString@System@@@Z)
Notice that the linker is complaining about GetJobW, NOT GetJob.
When I right click on GetJob and select "Go to Definition" it takes me to
winspool.h where the following block exists:
#ifdef UNICODE
#define GetJob GetJobW
#else
#define GetJob GetJobA
#endif // !UNICODE
Just for kicks I deleted this block and all of a sudden the linker worked!
BTW, when I link a native application (exe) with the same native dll and
call GetJob on my class it compiles and links just fine. So it seems to have
something to do with the fact that I am linking a managed dll with a native
dll.
Any help would be greatly appreciated
Thanks, Dave
There are two dlls in question: a c++ dll (native) and a c++/cli dll
(managed) with /clr option enabled.
Managed dll links with native dll.
Native dll exports a class ClientSession with a method GetJob.
Managed dll references this method and compiles just fine.
Managed dll does NOT link however and gives this error:
error LNK2028: unresolved token (0A000168) "public: class
Rimage::Simple::Api::Job * __thiscall
Rimage::Simple::Api::ClientSession::GetJobW(wchar_t const *)"
(?GetJobW@ClientSession@Api@Simple@Rimage@@$$FQAEPAVJob@234@PB_W@Z)
referenced in function "public: class Rimage::Simple:otnet::Api::Job ^
__clrcall Rimage::Simple:otnet::Api::ClientSession::GetJobW(class
System::String ^)"
(?GetJobW@ClientSession@Api@Dotnet@Simple@Rimage@@$$FQ$AAMP$AAVJob@2345@P$AAVString@System@@@Z)
Notice that the linker is complaining about GetJobW, NOT GetJob.
When I right click on GetJob and select "Go to Definition" it takes me to
winspool.h where the following block exists:
#ifdef UNICODE
#define GetJob GetJobW
#else
#define GetJob GetJobA
#endif // !UNICODE
Just for kicks I deleted this block and all of a sudden the linker worked!
BTW, when I link a native application (exe) with the same native dll and
call GetJob on my class it compiles and links just fine. So it seems to have
something to do with the fact that I am linking a managed dll with a native
dll.
Any help would be greatly appreciated
Thanks, Dave