cURL / Mailing Lists / curl-library / Single Mail


Undefined References using libcurl

From: Jason Buch <>
Date: Fri, 20 Feb 2009 11:28:23 -0600


I'm trying to use libcurl under cygwin/mingw but I'm running into some
trouble. At the moment, I'm just trying to compile and link a small sample
app, but I keep receiving undfined reference errors for all of the curl

I'm currently trying libcurl version 7.17.1 precompiled for mingw without
SSL. My lib options are:

LIBDBOPT=-lcurl -lzdll

And the errors are:

mingw32-g++.exe -o ../bin/debug/curlexample2.exe curlexample.o
-L../bin/debug -Wl,--enable-runtime-pseudo-reloc -Wl,--en
able-auto-image-base -Wl,--enable-auto-image-base -Wl,--enable-auto-import
-Wl,--add-stdcall-alias -Wl -lcurl -lzdll -mw
curlexample.o: In function `main':
c:/cygwin/bin/simulation/example/./curlexample.h:68: undefined reference to
c:/cygwin/bin/simulation/example/./curlexample.h:73: undefined reference to
c:/cygwin/bin/simulation/example/./curlexample.h:74: undefined reference to
c:/cygwin/bin/simulation/example/./curlexample.h:75: undefined reference to
c:/cygwin/bin/simulation/example/./curlexample.h:76: undefined reference to
c:/cygwin/bin/simulation/example/./curlexample.h:77: undefined reference to
curlexample.o:c:/cygwin/bin/simulation/example/./curlexample.h:78: more
undefined references to `__imp__curl_easy_setopt
' follow
curlexample.o: In function `main':
c:/cygwin/bin/simulation/example/./curlexample.h:81: undefined reference to
c:/cygwin/bin/simulation/example/./curlexample.h:84: undefined reference to
collect2: ld returned 1 exit status
make: *** [../bin/debug/curlexample2.exe] Error 1

I've previously gotten it to compile and link using cygcurl-3.dll version
7.15.4-2 instead of libcurl.a, but in that case the app locks up when
calling curl_easy_init.

Any help would be appreciated, as I just need to make some simple http calls
and this is holding up the whole app. Thanks.

Received on 2009-02-20