cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Undefined References using libcurl

From: Jason Buch <jbuch1_at_gmail.com>
Date: Fri, 20 Feb 2009 16:22:13 -0600

Nevermind. I got it. I had moved the LDFLAGS to last in the example app,
but not in my main app.

Jason

On Fri, Feb 20, 2009 at 4:17 PM, Jason Buch <jbuch1_at_gmail.com> wrote:

> Dan,
>
> 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
> `_curl_global_init'
> c:/cygwin/bin/simulation/AvalancheSR/AvCurl.cpp:43: undefined reference to
> `_curl_easy_init'
> collect2: ld returned 1 exit status
> make: *** [../bin/debug/AvalancheSR.exe] Error 1
>
> Thanks!
>
> Jason
>
>
> On Fri, Feb 20, 2009 at 12:53 PM, Dan Fandrich <dan_at_coneharvesters.com>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.
>>
>> http://curl.haxx.se/docs/faq.html#Link_errors_when_building_libcur
>>
>> --
>> http://www.MoveAnnouncer.com <http://www.moveannouncer.com/>
>> The web change of address service
>> Let webmasters know that your web site has moved
>>
>
>
Received on 2009-02-20