cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to build libcurl

From: Krishna Chaithanya Muthyala <chetan.eee_at_gmail.com>
Date: Thu, 20 Aug 2009 18:30:18 +0530

Hi,

What if I don't want to use the libcurl.so directly? I just download the
source-code and build myself to generate the .so. And my linux environment
already has libcurl installed.

Now, I don't want to use the already installed libcurl. Instead I want to
use the libcurl which I built myself. How to build my application which uses
libcurl then?

If -lcurl is given, I think gcc will take it from the installed libcurl in
the system.

Thanks and Regards,
krishna

On Thu, Aug 20, 2009 at 6:20 PM, Guenter <lists_at_gknw.net> wrote:

> Hi,
> sumana ts schrieb:
> > But it never worked for me.I have seen "-lcurl" linker option everywhere.
> > Is this option mandatory to build any libcurl application?
> yes.
>
> > If i build post example as seperate standalone application and link
> > without lcurl option.Its throwing undefined symbol references
> > errors.
> >
> > How would i use libcurl.so/libcurl.sl <http://libcurl.sl> in my linux
> > environment without -lcurl option?
> you always need -lcurl to tell the linker where to find the otherwise
> unresolved symbols - so at compile time its always mandatory.
> However if you mean that you want to have an independent binary which
> works without need to install libcurl then try this:
> - configure / compile libcurl with --disable-shared
> - compile your own app pointing to this libcurl
> this should result in a statically linked app which has no dependency to
> libcurl.so.
>
> Günter.
>
>
>
>
Received on 2009-08-20