Reputation: 347
I built CURL static lib from source using this command in the x64 Native Tools Command Prompt Visual Studio
nmake /f Makefile.vc mode=static MACHINE=AMD64
I added the lib folder to the linker library folder, added libcurl_a.lib to the linker input, and added the include folder to additional include directories. I also used the pre-processor define CURL_STATICLIB.
The library links successfully and the header is found. But I get 60 unresolved external symbols when I try to compile. https://hastebin.com/vukekakoti.tex
Dynamic linking is working with no problems.
How can I solve this?
Upvotes: 2
Views: 3693
Reputation: 21
if compiling CURL with static linking, you will need to specify on the preprocessor field:
CURL_STATICLIB
and also as mentioned above, you`ll need to link with dependent libraries.
Upvotes: 0
Reputation: 347
I was missing definitions contained in these libraries:
libcurl_a.lib;ws2_32.lib;wldap32.lib;advapi32.lib;kernel32.lib;comdlg32.lib;crypt32.lib;normaliz.lib
Add those to your additional dependencies.
Upvotes: 6