cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: warning when static build curl

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 19 Jul 2011 21:59:28 -0700

On Tue, Jul 19, 2011 at 05:37:08PM +0800, balloon wrote:
> So, if libcurl.a is completely static, it shouldn't depend on openssl, and
> SSL_write won't be undefined symbol in libcurl. Am I right?

No, not quite right. libcurl.a is static, therefore it is "completely"
static. However, it is not self-contained--it must be linked with
another library to satisfy the symbols it requires. These symbols include
things like "strlen", "socket" as well as potentially other symbols like
"BIO_new" and "SSL_write". How those symbols are resolved is up to you,
the application programmer, either statically or dynamically--nothing
in libcurl.a is dependent on one way or the other.

If you decide to dynamically link in other libraries, then you'll have
to ensure that those libraries (and their dependencies) are available
at run-time. If you decide to statically link in libraries to satisfy
those symbols, then you'll have to ensure that those libraries (and their
dependencies) are available at application link time. Which method to
use is decided at the time the libcurl-using application is linked and not
before. libcurl.a is never going to be the sole library that is linked against
an application to create a standalone program.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-07-20