curl / Mailing Lists / curl-library / Single Mail


Re: Compiling libcurl with HTTP/2 support in OpenWrt

From: Daniel Stenberg via curl-library <>
Date: Tue, 11 Dec 2018 12:46:28 +0100 (CET)

On Mon, 10 Dec 2018, Connor Ruggles via curl-library wrote:

> I'm compiling OpenWrt with their imagebuilder and including libcurl, with
> the HTTP/2 option checked. So I'm covering my bases there, and I have
> validated it is attempting at least to use the nghttp2 library because when
> I remove the linked library objects, libcurl fails to make any requests and
> my program crashes.

Do you link with shared version of libcurl and nghttp2? If so, removing the
libs should prevent your application from even starting since it can't link
the libraries at run-time.

If you linked statically, then removing "the linked library objects" will not
have any effect since they're already linked with your application.

> In my code, I have the HTTP version option as
> `CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE`. I have compiled the same version of
> curl on an Ubuntu machine with http2 support, and queried the same server
> that my program is querying, and my request is indeed upgraded to HTTP/2, so
> I know it's either a problem with the libcurl configuration on my device or
> a problem on the device itself.

At the end of curl's configure run it displays a summary of the build options
and what features it will enable in the build etc. That should say that http2
is enabled. You can also use curl_version_info() [1] in your application to
figure out exactly what your built libcurl supports. The 'features' bitmask
has the CURL_VERSION_HTTP2 bit set when HTTP/2 support is present.

I would also recommend using CURLOPT_VERBOSE set to 1L when debugging your
application so that you'll more details and information from libcurl about its

[1] =

Received on 2018-12-11