简体   繁体   中英

Dll only loads correctly via LoadLibrary?

I'm trying to use dbghelp.dll. If I set it up in the VS2008 properties to point to the correct library and header file, and put dbghelp.dll in the same directory as the executable, one of the functions in the dll fails. If I LoadLibrary the dll, everything that function works. I've looked at the header that gets included via the VS option, and the right one is being pulled in. The correct lib is being pulled in (checked via /verbose option), and depends.exe shows the correct dll is loaded. Does anyone know why I can't get this to work? I'll probably just go with LoadLibrary, but I'm genuinely stumped on this one.

EDIT: SymfromAddr fails with an "error 87", whatever that is. If I load the dll via LoadLibrary, it works.

Did you linked with Dbghelp.lib via proj settings or #pragma comment(lib,"Dbghelp.lib") ? If you do the dll will be loaded during app initialization.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM