curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Unable to successfully use library in project

From: Ray Satiro <raysatiro_at_yahoo.com>
Date: Wed, 18 Jul 2018 14:24:07 -0400

On 7/17/2018 9:27 PM, Dillon Korman wrote:
> I get the following errors when I try to build the project:
>
> 1>project.obj : error LNK2001: unresolved external symbol
> __imp_curl_easy_init
> 1> project.obj : error LNK2001: unresolved external symbol
> __imp_curl_easy_setopt
> 1> project.obj : error LNK2001: unresolved external symbol
> __imp_curl_easy_perform
> 1> project.obj : error LNK2001: unresolved external symbol
> __imp_curl_easy_strerror
> 1> project.obj : error LNK2001: unresolved external symbol
> __imp_curl_easy_cleanup
> 1>C:\Users\user\source\repos\project\x64\Release\project.exe : fatal
> error LNK1120: 5 unresolved externals
>
> After some Googling, it looked like I may need to add CURL_STATICLIB
> to my preprocessor definitions in the project properties. I do so and
> I get the following errors:
>
> 1>libcurl_a.lib(easy.obj) : error LNK2001: unresolved external symbol
> __imp_WSAStartup
> 1>libcurl_a.lib(telnet.obj) : error LNK2001: unresolved external
> symbol __imp_WSAStartup
> 1>libcurl_a.lib(easy.obj) : error LNK2001: unresolved external symbol
> __imp_WSACleanup
> ...
> 1>libcurl_a.lib(connect.obj) : error LNK2001: unresolved external
> symbol __imp_connect
> 1>libcurl_a.lib(connect.obj) : error LNK2001: unresolved external
> symbol __imp_getpeername
> 1>libcurl_a.lib(connect.obj) : error LNK2001: unresolved external
> symbol __imp_getsockname
> 1>libcurl_a.lib(ftp.obj) : error LNK2001: unresolved external symbol
> __imp_getsockname
> ...
> 1>libcurl_a.lib(curl_gethostname.obj) : error LNK2001: unresolved
> external symbol __imp_gethostname
> 1>libcurl_a.lib(krb5_sspi.obj) : error LNK2001: unresolved external
> symbol __imp_htonl
> 1>libcurl_a.lib(krb5_sspi.obj) : error LNK2001: unresolved external
> symbol __imp_ntohl
> 1>C:\Users\user\source\repos\project\x64\Release\project.exe : fatal
> error LNK1120: 60 unresolved externals
>
> Could someone please let me know where I have messed up or what I am
> doing wrong? I have included the full command line flags, with
> "CURL_STATICLIB" defined. Thank you.

You'll need to add the libraries that static libcurl depends on, which
it looks like in your case is only winsock2 ws2_32.lib.

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-07-18