cURL / Mailing Lists / curl-library / Single Mail


Re: Undefined References using libcurl

From: Jason Buch <>
Date: Fri, 20 Feb 2009 16:17:25 -0600


Thanks. I could have sworn I'd tried adding -DCURL_STATICLIB before. That
(and several additional libs) fixed things for the example app, but now
trying to add curl into my main app, I still get undefined references. Here
are my makefile options:

My main app that fails:

LIBDBOPT=-lOgreMain_d -lois_d -lCEGUIBase_d -lOgreGUIRenderer_d
-llibPagedGeometry -lOpenAL32 -lOgreAL_d -lvorbis -lvorbisfile -logg -lcurl
-lzdll -lwinmm -lwldap32 -lws2_32 -lz -lws2_32 -liberty

CXXFLAGS=-Wall -mthreads -fmessage-length=0 -fexceptions -fident -pipe
-DWIN32 -DCURL_STATICLIB -D_WINDOWS $(DBOPT) -I- -I. -I..\include plus many
more include directories. -I..\curl\include -I..\curl\include\curl -c

My sample app that works:

LIBDBOPT= -lcurl -lzdll -lwinmm -lwldap32 -lws2_32 -lz -lws2_32 -liberty
CXXFLAGS=-Wall -mthreads -fmessage-length=0 -fexceptions -fident -pipe
-DWIN32 -DCURL_STATICLIB -D_WINDOWS $(DBOPT) -I- -I. -I../curl/include
-I../curl/include/curl -c

And the errors I receive:

AvCurl.o: In function `_ZN6AvCurl7getPageEv':
c:/cygwin/bin/simulation/AvalancheSR/AvCurl.cpp:35: undefined reference to
c:/cygwin/bin/simulation/AvalancheSR/AvCurl.cpp:43: undefined reference to
collect2: ld returned 1 exit status
make: *** [../bin/debug/AvalancheSR.exe] Error 1



On Fri, Feb 20, 2009 at 12:53 PM, Dan Fandrich <>wrote:

> On Fri, Feb 20, 2009 at 11:28:23AM -0600, Jason Buch wrote:
> > 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.
> --
> <>
> The web change of address service
> Let webmasters know that your web site has moved
Received on 2009-02-20