cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: compile libcurl into the application (MSVC)

From: Guenter <lists_at_gknw.net>
Date: Fri, 17 Jul 2009 20:31:13 +0200

Hi,
if you use a dinosaur fullautomatic IDE / compiler then at some point
you should learn how to use it, and realize that fullautomatic choices
do not always work :)
Cyber Core schrieb:
> The errors I getting now during the build process:
>
> MSVCRT.lib(MSVCRT.dll) : error LNK2005: _calloc already defined in
> LIBCMT.lib(calloc.obj)
> MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in
> LIBCMT.lib(realloc.obj)
......
> LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other
> libs; use /NODEFAULTLIB:library
here the error message even suggests you how you might be able to solve
it - if that still makes no sense for you then try Google with this
error message, for it reveals as 4th result:
http://msdn.microsoft.com/en-us/library/aa267384(VS.60).aspx

> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_unbind_s
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_msgfree
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_next_entry
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ber_free
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_next_attribute
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_memfree
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_value_free_len
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_get_values_len
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_first_attribute
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_get_dn
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_first_entry
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_search_s
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_simple_bind_s
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_init
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_set_option
> libcurl.lib(ldap.obj) : error LNK2001: unresolved external symbol
> __imp__ldap_err2string
>
> So what now?
here you have again same issue: since you are used to trust the IDE's
fullautomatic mode you never think of, or even learn what OS libraries
you really need, and where imports are located; these imports are
located in wldap32.lib which you need to add to your project manually
since fullautomatic never does :)
If you also google for one of these error messages then first result is:
http://curl.haxx.se/mail/lib-2007-11/0300.html
so you see this is a frequently asked question.
BTW. another option is if you dont need LDAP support in your own project
you can also disable LDAP with a define when you build libcurl.

Gün.
Received on 2009-07-17