cURL / Mailing Lists / curl-library / Single Mail

curl-library

Undefined References using libcurl

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

Hello,

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

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
indows
curlexample.o: In function `main':
c:/cygwin/bin/simulation/example/./curlexample.h:68: undefined reference to
`__imp__curl_easy_init'
c:/cygwin/bin/simulation/example/./curlexample.h:73: undefined reference to
`__imp__curl_easy_setopt'
c:/cygwin/bin/simulation/example/./curlexample.h:74: undefined reference to
`__imp__curl_easy_setopt'
c:/cygwin/bin/simulation/example/./curlexample.h:75: undefined reference to
`__imp__curl_easy_setopt'
c:/cygwin/bin/simulation/example/./curlexample.h:76: undefined reference to
`__imp__curl_easy_setopt'
c:/cygwin/bin/simulation/example/./curlexample.h:77: undefined reference to
`__imp__curl_easy_setopt'
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
`__imp__curl_easy_perform'
c:/cygwin/bin/simulation/example/./curlexample.h:84: undefined reference to
`__imp__curl_easy_cleanup'
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.

Jason
Received on 2009-02-20