cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to make a statically linked binary in linux with curllib

From: Michael Wood <esiotrot_at_gmail.com>
Date: Tue, 17 Mar 2009 11:29:15 +0200

On Tue, Mar 17, 2009 at 7:17 AM, sourav roy <sourav.roy.moto_at_gmail.com> wrote:
> Hi,
>
> 1.How I can make a statically binary in linux as I don't want to export
> LD_LIBRARY_PATH before running the binary.
> I know that it will make size of binary bigger but really want it.
>
> here is line to build my binary
> gcc -I/usr/local/include/curl/ -L/usr/local/lib64 -L/usr/local/ssl/lib
> -lcurl -lssl -lcrypto -o test1 test1.c
> before running i m sourcing the LD_LIBRARY_PATH

Maybe you could also try using the "-rpath" option to ld instead of
building a static binary? Or just add /usr/local/lib64 and
/usr/local/ssl/lib to your ld.so.conf.

-- 
Michael Wood <esiotrot_at_gmail.com>
Received on 2009-03-17