Reputation: 210
I'm trying to use an external DLL (provided by AutoItX) with Visual C++ 2010. AutoItX provides a DLL, but for some reason not a LIB, so I generated one with Visual Studio.
The problem is that the linker seems to have trouble linking against the library. I added AutoItX3.lib as an additional dependency under Properties->Linker -> Inputs, and added the directory to Properties -> Linker -> General -> Additional Library Directories. No matter what I do, I still get these errors:
1>main.obj : error LNK2019: unresolved external symbol _AU3_Send@8 referenced in function _WinMain@16
1>main.obj : error LNK2019: unresolved external symbol _AU3_WinWaitActive@12 referenced in function _WinMain@16
1>main.obj : error LNK2019: unresolved external symbol _AU3_Run@12 referenced in function _WinMain@16
1>main.obj : error LNK2019: unresolved external symbol _AU3_Sleep@4 referenced in function _WinMain@16
AU3_Send, AU3_WinWaitActive, AU3_Run, and AU3_Sleep are functions called by the program, main.cpp. I'm really out of ideas, because these functions clearly exist in the DLL. Any help would be appreciated.
Upvotes: 1
Views: 1853
Reputation: 6324
It is very common to provide only DLLs as a mean of interfaces. Many software providers do that. Doing this has following impacts (consequences):
To resolve your problem you just need to remove the static dependency (the LIB) you put in the Visual Studio configuration and set the dependency at runtime using LoadLibrary and GetProcAddress
Upvotes: 1