DLL and name Mangling

I have a third-party LIB that exports characters like regular C / cdecl, therefore, for example, dumpbin.exe /SYMBOLSit reports that both __imp_nvmlInit, and so are exported nvmlInit.

However, in Visual Studio 2010, when I try to import them, the header file will have

extern "C" nvmlReturn_t nvmlInit(...);

but when I try to compile, I get the following error:

main.obj: error LNK2019: unresolved external symbol _nvmlInit refers to the _main function

How can I stop Visual Studio from searching for this leading underscore character? __declspect(dllimport)doesn't work because then it decorates __imp__nvmlInit(one underline is too much).

Thank.

+3
source share
1 answer

. .LIB, DLL, , , DLL.

+1

All Articles