cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Building and using static libcurl on Windows with VS2008

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 06 Jan 2009 15:13:03 +0100

"Sergei Trofimov" <sergei.trofimov_at_gmail.com> wrote:

> 1>curllib.lib(easy.obj) : error LNK2001: unresolved external symbol
> __imp__WSACleanup_at_0

...

Add 'ws2_32.lib' to you linker command. Also, if you need the ldap
protocol (small chance), add wldap32.lib also. If you don't need
ldap, add '-DCURL_DISABLE_LDAP' to you CFLAGS while building
libcurl.

> 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".

It's CURL_STATICLIB (the .doc must be wrong if it says otherwise).
Anyway, this option needs the user to link in Winsock. Normally
(when not using CURL_STATICLIB), the ABI exposed by libcurl.dll does
not depend on ws2_32 (winsock). It only when you make a static
lib. that you the user needs to provide the needed libs.
Clearer?

--gv
Received on 2009-01-06