cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: distributing a compiled program using libcurl

From: Ken Weinert <Ken.Weinert_at_ihs.com>
Date: Tue, 02 Nov 2004 08:25:14 -0700

On Tue, 2004-11-02 at 07:26, Flavio Tischhauser wrote:
> Hi everyone
>
> First of all, thanks to everyone involved on the development of
> curl/libcurl - it's really great!
>
> I developed a CGI program in C/C++ which uses libcurl to make it's own
> HTTP requests. When compiled on my development machine (SuSE Linux 9.0,
> using the default libcurl), I get a 175KB file which is ok.
>
> I want to provide this CGI to others in a precompiled binary form, so
> others can use my CGI without having libcurl installed. I compiled my
> program again with the "--static" flag and got a whopping 4.5MB file -
> pretty big for a CGI program. Or does anyone know if Apache/Linux
> caching is intelligent enough to prevent the additional
> filesystem/memory load?

I believe what you've done is compile in every static version of *all*
libraries, including system ones - you probably don't want that :)

Unfortunately I don't recall offhand the proper way to specify only
libcurl as static, but one thing you can do is this:

1) copy libcurl.a into the directory you're compiling in
2) change your makefile/compilation line specify libcurl.a instead of
-lcurl

I *know* there is a better way and a proper perusal of the compiler and
its arguments will garner you a more robust solution, but this should
get you a much smaller executable quickly while you research the issue.

HTH
Received on 2004-11-02