1
votes

I've been reading all over the internet and tried many things but still I cannot seem to find the problem. I'm trying to use libcurl as a static lib but here is what my compiler says :

1>libcurl.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp__fgets 1>libcurl.lib(netrc.obj) : error LNK2001: unresolved external symbol __imp__fgets 1>libcurl.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp__fputs 1>libcurl.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf 1>libcurl.lib(rtsp.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf 1>libcurl.lib(socks.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf 1>libcurl.lib(http_proxy.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf

And so on..

I have added CURL_STATICLIB to preprocessor and even linked with these libraries: libcurl.lib openssl.lib, libssh2.lib, zlib.lib, wsock32.lib, wldap32.lib, ws2_32.lib but none of this worked.

I really would like to use it as a static library (without the .dll in the program folder) so I will appreciate if someone could help me!

PS. I am using VS2015

1
Hopefully you mean CURL_STATICLIB and not CRUL_STATICLIB.Colin Basnett
yeah that was a mistype.usr1408

1 Answers

5
votes

Set RTLIBCFG=static in the Visual Studio command prompt. This will set up the compiler to build for /MT and /MTd . That was the problem apperantly.. Hopefully someone with the same problem will benefit out of this! Cheers!