Currently, if you compile static libraries with CMake on Windows (via -DBUILD_SHARED_LIBS=off + -DBUILD_STATIC_LIBS=on), the generated nghttp2.h file does not define NGHTTP2_STATICLIB resulting in such errors:
ld.lld: error: undefined symbol: __declspec(dllimport) nghttp2_option_set_no_auto_window_update
>>> referenced by lib/CMakeFiles/libcurl_object.dir/cf-h2-proxy.c.obj:(cf_h2_proxy_connect)
>>> referenced by lib/CMakeFiles/libcurl_object.dir/http2.c.obj:(cf_h2_ctx_init)
...
Currently, if you compile static libraries with CMake on Windows (via
-DBUILD_SHARED_LIBS=off
+-DBUILD_STATIC_LIBS=on
), the generatednghttp2.h
file does not defineNGHTTP2_STATICLIB
resulting in such errors:As a fix, we could add this to CMakeLists.txt
and add this line to cmakeconfig.h
and in nghttp2.h: