curl / Mailing Lists / curl-library / Single Mail


Re: Is there a way to statically link only nghttp2 but not others (openssl)

From: Sunil Sayyaparaju via curl-library <>
Date: Thu, 4 Jan 2018 13:02:38 +0530

Yes, as you said, the problem is with the mix and match.

I use the following to do static linking.
LIBS="-ldl" LDFLAG="-static" ./configure --disable-shared --enable-static
But it expects static libs of openssl also even if I did not specify its
Because of the screwed up openssl-static on centos 7, HTTPS is not enabled.

If I do not use static linking, it expects to have run-time nghttp2.
./configure --disable-shared --enable-static --with-nghttp2=/path/to/nghttp2
For the above command configure fails with this error (which is expected)
"one or more libs available at link-time are not available run-time"
How should I instruct configure to not look for run-time libs of nghttp2 ?

- Sunil

On Thu, Jan 4, 2018 at 10:14 AM, Daniel Stenberg <> wrote:

> On Tue, 2 Jan 2018, Sunil Sayyaparaju via curl-library wrote:
> So, I am wondering if I can only statically link with nghttp2 but not
>> openssl. Is there a way ?
> Sure. The regular linker can mix and match both shared and static ones. I
> find it is often easiest if I don't even have any shared ones to offer and
> just specify the path to the dir with the static ones and provide the right
> -L and -l options. If you have both installed, you of course need to use
> ld's or gcc'c "-static" options.
> Linking statically is generally a pain since you need to provide all the
> sub dependencies and do that in the right order etc.
> --
> /

Received on 2018-01-04