For the background, I came across this by porting the middle version of Linux code (compiling to giant .so) to x64 windows (compiling into .dll). I had problems with the linker.
As a minimal test file, if I create a Visual Studio project only from the following file:
#include <Windows.h> #include <Dbghelp.h> void do_stuff(char const * s) { char buffer[4096]; long int len = UnDecorateSymbolName( s, buffer, sizeof(buffer), UNDNAME_COMPLETE); }
And I set the project type in the DLL and built it, I get the error message "LNK2001: unresolved external symbol __imp_UnDecorateSymbolName". That is, the file compiles correctly, but does not communicate with the dll.
I think the purpose of my dll is to link to dbghelp.dll, especially since (at least on my system) there is no such file as dbghelp.lib. So why is he trying to resolve this symbol now, and not when my DLL is loading into the application? And why can't he see this function anyway?
To be clear, I confirmed that I am creating an x64 DLL, and dbghelp.dll in C: \ Windows \ System32 - x64.
source share