cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: how to link during build/compile

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 16 Jan 2009 14:40:52 -0800

On Fri, Jan 16, 2009 at 05:22:51PM -0500, macaco wrote:
> Dan Fandrich wrote:
> Try moving the -lcurl to the end of the gcc command line. You may also need
> to add a flag -L/path/to/libcurl.a to indicate where the libcurl library
> is located.
>
> That was it,
> gcc -L/usr/lib/libcurl.a curlexample.c -lcurl
>
> and worked... thanks.

Glad that fixed it. I see now that the example I gave was pretty poor. By
/path/to/libcurl.a I meant the directory in which libcurl.a was located.
In your case, that would mean the flag -L/usr/lib But since /usr/lib is in
the linker's standard library search path, you can drop the -L option
altogether and the link should still work.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-01-16