curl-library
Re: ld.exe: cannot find -lcurl
Date: Tue, 31 Jul 2012 09:00:42 -0400
I found the solution on a codeblocks help site, the command: "$ gcc -o live
live.c -DCURL_STATICLIB -I/usr/local/include -L/usr/local/lib -lcurl
-lws2_32 -lwinmm" works like a charm! Thanks for all your help Gisle!
Chris
On Tue, Jul 31, 2012 at 8:54 AM, Chris Ch <charch86_at_gmail.com> wrote:
> Oh yes, sorry I am using msys. I have tried that too, but when I do I get
> the "__imp__" errors even though we are using the "-DCURL_LIBSTATIC" flag.
> This is really frustrating! Here is the MSYS output:
>
> $ gcc -o live live.c -DCURL_STATICLIB -I/usr/local/include \
> > /usr/local/lib/libcurl.a -lws2_32
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x21e):
> u
> ndefined reference to `__imp__ldap_err2stringA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x264):
> u
> ndefined reference to `__imp__ldap_msgfree'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x295):
> u
> ndefined reference to `__imp__ldap_unbind_s'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x6c7):
> u
> ndefined reference to `__imp__ldap_set_optionA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x6ea):
> u
> ndefined reference to `__imp__ldap_sslinitA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x74e):
> u
> ndefined reference to `__imp__ldap_simple_bind_sA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x7a5):
> u
> ndefined reference to `__imp__ldap_search_sA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x7c3):
> u
> ndefined reference to `__imp__ldap_err2stringA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x851):
> u
> ndefined reference to `__imp__ldap_err2stringA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x8b4):
> u
> ndefined reference to `__imp__ldap_set_optionA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x8cf):
> u
> ndefined reference to `__imp__ldap_initA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x909):
> u
> ndefined reference to `__imp__ldap_first_entry'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x94a):
> u
> ndefined reference to `__imp__ldap_get_dnA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0x9e9):
> u
> ndefined reference to `__imp__ldap_first_attributeA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xa15):
> u
> ndefined reference to `__imp__ldap_get_values_lenA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xbf5):
> u
> ndefined reference to `__imp__ldap_value_free_len'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xc4a):
> u
> ndefined reference to `__imp__ldap_memfreeA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xc69):
> u
> ndefined reference to `__imp__ldap_next_attributeA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xc82):
> u
> ndefined reference to `__imp__ldap_memfreeA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xc9d):
> u
> ndefined reference to `__imp__ber_free'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xcb2):
> u
> ndefined reference to `__imp__ldap_next_entry'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xcdb):
> u
> ndefined reference to `__imp__ldap_value_free_len'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xce8):
> u
> ndefined reference to `__imp__ldap_memfreeA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xcf7):
> u
> ndefined reference to `__imp__ldap_memfreeA'
> C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ldap.o):ldap.c:(.text+0xd16):
> u
> ndefined reference to `__imp__ber_free'
> collect2.exe: error: ld returned 1 exit status
>
> On Tue, Jul 31, 2012 at 8:40 AM, Gisle Vanem <gvanem_at_broadpark.no> wrote:
>
>> "Chris Ch" <charch86_at_gmail.com> wrote:
>>
>> Chris_at_Chris-HP ~
>>> $ gcc -o live live.c -DCURL_STATICLIB -I/usr/local/include
>>> /usr/local/lib/libcu
>>>
>>
>> From your prompt, I thought you were not on Win32. How come
>> you have "/usr/local/lib" on MingW? Sure you don't use MSys?
>> In any case use:
>>
>>
>> gcc -o live live.c -DCURL_STATICLIB -I/usr/local/include \
>> /usr/local/lib/libcurl.a -lws2_32
>>
>>
>> --gv
>> ------------------------------**------------------------------**-------
>> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
>> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>>
>
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-31