cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: ld.exe: cannot find -lcurl

From: Chris Ch <charch86_at_gmail.com>
Date: Tue, 31 Jul 2012 08:13:33 -0400

I have tried your suggestion and it is now giving me even more errors :S I
am new to using Mingw/GCC and curl so I'm sorry for this really stupid
question.

Chris_at_Chris-HP ~
$ gcc -o live live.c -DCURL_STATICLIB -I/usr/local/include
/usr/local/lib/libcu
rl.a
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-easy.o):easy.c:(.text+0x16):
un
defined reference to `_WSAStartup_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-easy.o):easy.c:(.text+0x39):
un
defined reference to `_WSACleanup_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-easy.o):easy.c:(.text+0x18d):
u
ndefined reference to `_WSACleanup_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-transfer.o):transfer.c:(.text+0
x213d): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-sendf.o):sendf.c:(.text+0x147):
 undefined reference to `_recv_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-sendf.o):sendf.c:(.text+0x161):
 undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-sendf.o):sendf.c:(.text+0x7b6):
 undefined reference to `_recv_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-sendf.o):sendf.c:(.text+0x7d5):
 undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-sendf.o):sendf.c:(.text+0x85a):
 undefined reference to `_send_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-sendf.o):sendf.c:(.text+0x879):
 undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xd
8): undefined reference to `_getsockopt_at_20'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x1
05): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x1
67): undefined reference to `_ntohs_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x2
df): undefined reference to `_getpeername_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x2
eb): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x3
42): undefined reference to `_getsockname_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x3
c1): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x4
6c): undefined reference to `_getsockopt_at_20'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x4
ac): undefined reference to `_setsockopt_at_20'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x5
20): undefined reference to `_recv_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x5
62): undefined reference to `_closesocket_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x6
54): undefined reference to `_socket_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x8
dd): undefined reference to `_htons_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x9
24): undefined reference to `_setsockopt_at_20'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x9
85): undefined reference to `_setsockopt_at_20'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xa
60): undefined reference to `_bind_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xa
a2): undefined reference to `_ntohs_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xa
fe): undefined reference to `_getsockname_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xb
99): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xd
30): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xd
8b): undefined reference to `_connect_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xe
d4): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0xf
0d): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x1
26a): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-connect.o):connect.c:(.text+0x1
33a): undefined reference to `_WSASetLastError_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-curl_addrinfo.o):curl_addrinfo.
c:(.text+0x13e): undefined reference to `_htons_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-hostip4.o):hostip4.c:(.text+0x5
c): undefined reference to `_gethostbyname_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xd88):
und
efined reference to `_bind_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xd98):
und
efined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xdd7):
und
efined reference to `_htons_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xe2b):
und
efined reference to `_getsockname_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xe3b):
und
efined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xf09):
und
efined reference to `_getsockname_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xf29):
und
efined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xf8c):
und
efined reference to `_getsockname_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0xf9c):
und
efined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0x108e):
un
defined reference to `_listen_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0x109a):
un
defined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0x11a2):
un
defined reference to `_ntohs_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0x1201):
un
defined reference to `_ntohs_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0x13e1):
un
defined reference to `_getsockname_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0x1430):
un
defined reference to `_accept_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-ftp.o):ftp.c:(.text+0x2aed):
un
defined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text+0x3f0
): undefined reference to `_WSAStartup_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text+0x426
): undefined reference to `_WSACleanup_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text+0xe22
): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text+0xe4c
): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text+0xea2
): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x17b): undefined reference to `_send_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x18b): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x3bb): undefined reference to `_ntohs_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x3cb): undefined reference to `_ntohs_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x5bd): undefined reference to `_htons_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x5d2): undefined reference to `_htons_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x6ae): undefined reference to `_send_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x6ba): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x708): undefined reference to `_send_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x714): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x853): undefined reference to `_send_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x85f): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x9ad): undefined reference to `_send_at_16'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-telnet.o):telnet.c:(.text.unlik
ely+0x9b9): undefined reference to `_WSAGetLastError_at_0'
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'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x210):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x29b):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x2fd):
u
ndefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x365):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x3e6):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x75d):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x7b2):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x891):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x94d):
u
ndefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x981):
u
ndefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x9ee):
u
ndefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0xb32):
u
ndefined reference to `_bind_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0xbad):
u
ndefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x1069):
undefined reference to `_sendto_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x1075):
undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x1140):
undefined reference to `_recvfrom_at_24'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x1749):
undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-tftp.o):tftp.c:(.text+0x1b3a):
undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x2e)
: undefined reference to `_WSASetLastError_at_4'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x2ae
): undefined reference to `_select_at_20'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x2bd
): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x354
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x374
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x3b4
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x3d1
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x42f
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x445
): more undefined references to `___WSAFDIsSet_at_8' follow
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x77d
): undefined reference to `_select_at_20'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x78c
): undefined reference to `_WSAGetLastError_at_0'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x849
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x863
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-select.o):select.c:(.text+0x884
): undefined reference to `___WSAFDIsSet_at_8'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-nonblock.o):nonblock.c:(.text+0
x2a): undefined reference to `_ioctlsocket_at_12'
C:/MinGW/msys/1.0/local/lib/libcurl.a(libcurl_la-curl_gethostname.o):curl_gethos
tname.c:(.text+0x19): undefined reference to `_gethostname_at_8'
collect2.exe: error: ld returned 1 exit status

On Tue, Jul 31, 2012 at 3:46 AM, Gisle Vanem <gvanem_at_broadpark.no> wrote:

> "Chris Ch" <charch86_at_gmail.com> wrote:
>
> I am trying to compile a simple program which uses libcurl with Mingw
>> using
>> Msys. Here is my command and the output given:
>>
>> Chris_at_Chris-HP ~
>> $ gcc -L/usr/local/lib/libcurl.a -o live live.c -DCURL_STATICLIB
>> -I/usr/local/include -lcurl
>> c:/mingw/bin/../lib/gcc/**mingw32/4.7.0/../../../../**mingw32/bin/ld.exe:
>> cannot find -lcurl
>>
>
> The '-L' option (ld search-path) is supposed to contain a directory
> (not a file). IMHO it's better to explicitly tell the linker what lib to
> use;
>
> gcc -o live live.c -DCURL_STATICLIB -I/usr/local/include
> /usr/local/lib/libcurl.a
> Since (on Windows at least), if you use '-lcurl', GNU ld will use
> 'libcurl.dll.a' if both
> libcurl.dll.a and libcurl.a are present in the same directory. Very
> annoying.
>
> --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