curl-library
Building and using static libcurl on Windows with VS2008
Date: Tue, 6 Jan 2009 16:46:06 +0300
Hi All,
I read probably all documentation about how to do it but still have problems.
I decided to start with building and using static libcurl without any
additional features like ssh2, ssl etc.
So I download the sources, open curlib.vcproj in VS 2008, added
"CURL_STATIC" in preprocessor definitions and build static library(I'm
following the instruction from
http://curl.haxx.se/libcurl/c/Using-libcurl-with-SSH-support-in-Visual-Studio-2008.pdf).
Library build successfully. Then I created C++ console project with
simple curllib example, also added "CURL_STATIC" in preprocessor
definitions and added path to curl library and headers. I'm also made
sure that both library and application build with /MD.
But unfortunately during the linking I got a bunch of unresolved links:
1> Creating library
C:\My\Development\CurlC++Test\Release\CurlC++Test.lib and object
C:\My\Development\CurlC++Test\Release\CurlC++Test.exp
1>curllib.lib(easy.obj) : error LNK2001: unresolved external symbol
__imp__WSACleanup_at_0
1>curllib.lib(telnet.obj) : error LNK2001: unresolved external symbol
__imp__WSACleanup_at_0
1>curllib.lib(easy.obj) : error LNK2001: unresolved external symbol
__imp__WSAStartup_at_8
1>curllib.lib(telnet.obj) : error LNK2001: unresolved external symbol
__imp__WSAStartup_at_8
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__closesocket_at_4
1>curllib.lib(http.obj) : error LNK2001: unresolved external symbol
__imp__closesocket_at_4
1>curllib.lib(multi.obj) : error LNK2001: unresolved external symbol
__imp__closesocket_at_4
1>curllib.lib(url.obj) : error LNK2001: unresolved external symbol
__imp__closesocket_at_4
1>curllib.lib(transfer.obj) : error LNK2001: unresolved external
symbol __imp__closesocket_at_4
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__closesocket_at_4
1>curllib.lib(hostthre.obj) : error LNK2001: unresolved external
symbol __imp__closesocket_at_4
1>curllib.lib(tftp.obj) : error LNK2001: unresolved external symbol
__imp__WSAGetLastError_at_0
1>curllib.lib(telnet.obj) : error LNK2001: unresolved external symbol
__imp__WSAGetLastError_at_0
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__WSAGetLastError_at_0
1>curllib.lib(select.obj) : error LNK2001: unresolved external symbol
__imp__WSAGetLastError_at_0
1>curllib.lib(transfer.obj) : error LNK2001: unresolved external
symbol __imp__WSAGetLastError_at_0
1>curllib.lib(sendf.obj) : error LNK2001: unresolved external symbol
__imp__WSAGetLastError_at_0
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__WSAGetLastError_at_0
1>curllib.lib(hostthre.obj) : error LNK2001: unresolved external
symbol __imp__WSAGetLastError_at_0
1>curllib.lib(sendf.obj) : error LNK2001: unresolved external symbol
__imp__recv_at_16
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__recv_at_16
1>curllib.lib(sendf.obj) : error LNK2001: unresolved external symbol
__imp__send_at_16
1>curllib.lib(telnet.obj) : error LNK2001: unresolved external symbol
__imp__send_at_16
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__ioctlsocket_at_12
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__ntohs_at_4
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__ntohs_at_4
1>curllib.lib(socks.obj) : error LNK2001: unresolved external symbol
__imp__ntohs_at_4
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__getsockname_at_12
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__getsockname_at_12
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__bind_at_12
1>curllib.lib(tftp.obj) : error LNK2001: unresolved external symbol
__imp__bind_at_12
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__bind_at_12
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__htons_at_4
1>curllib.lib(curl_addrinfo.obj) : error LNK2001: unresolved external
symbol __imp__htons_at_4
1>curllib.lib(socks.obj) : error LNK2001: unresolved external symbol
__imp__htons_at_4
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__getsockopt_at_20
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__setsockopt_at_20
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__connect_at_12
1>curllib.lib(connect.obj) : error LNK2001: unresolved external symbol
__imp__socket_at_12
1>curllib.lib(hostthre.obj) : error LNK2001: unresolved external
symbol __imp__socket_at_12
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__socket_at_12
1>curllib.lib(curl_addrinfo.obj) : error LNK2001: unresolved external
symbol __imp__freeaddrinfo_at_4
1>curllib.lib(curl_addrinfo.obj) : error LNK2001: unresolved external
symbol __imp__getaddrinfo_at_16
1>curllib.lib(hostthre.obj) : error LNK2001: unresolved external
symbol __imp__gethostbyname_at_4
1>curllib.lib(hostthre.obj) : error LNK2001: unresolved external
symbol __imp__WSASetLastError_at_4
1>curllib.lib(select.obj) : error LNK2001: unresolved external symbol
__imp__WSASetLastError_at_4
1>curllib.lib(tftp.obj) : error LNK2001: unresolved external symbol
__imp__sendto_at_24
1>curllib.lib(tftp.obj) : error LNK2001: unresolved external symbol
__imp__recvfrom_at_24
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_unbind_s
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_msgfree
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_next_entry
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ber_free
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_next_attribute
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_memfree
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_value_free_len
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_get_values_len
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_first_attribute
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_get_dn
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_first_entry
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_search_s
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_simple_bind_s
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_init
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_set_option
1>curllib.lib(ldap.obj) : error LNK2001: unresolved external symbol
__imp__ldap_err2string
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__accept_at_12
1>curllib.lib(ftp.obj) : error LNK2001: unresolved external symbol
__imp__listen_at_8
1>curllib.lib(select.obj) : error LNK2001: unresolved external symbol
___WSAFDIsSet_at_8
1>curllib.lib(select.obj) : error LNK2001: unresolved external symbol
__imp__select_at_20
1>C:\My\Development\CurlC++Test\Release\CurlC++Test.exe : fatal error
LNK1120: 41 unresolved externals
Can someone pint me where I'm wrong?
BTW "Using-libcurl-with-SSH-support-in-Visual-Studio-2008.pdf" doc
asking to set "CURL_STATIC" flag but install guide asking for
"CURL_STATICLIB".
Anyway I tried to build both lib and app with both flags and got the same error.
-- --SergeiReceived on 2009-01-06