c++ - DLL and Name Mangling -
i have third-party lib has symbols exported plain c/cdecl, example dumpbin.exe /symbols
reports both __imp_nvmlinit
, nvmlinit
exported.
however in visual studio 2010 when try import them, header file have
extern "c" nvmlreturn_t nvmlinit(...);
but when try compile, following error:
main.obj : error lnk2019: unresolved external symbol _nvmlinit referenced in function _main
how can stop visual studio looking symbol leading underscore? __declspect(dllimport)
doesn't work because decorates __imp__nvmlinit
(one underscore many).
thanks.
that linker error. need link .lib file associated dll, give linker promise function available @ run-time when dll loaded.
Comments
Post a Comment