You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To compile curl on Windows with MSVC and statically link all dependencies, I used these steps:
Build quictls/openssl
Build Command:
git reset --hard
git clean -fdx
perl Configure VC-WIN64A Debug no-shared \
--prefix=[path to ssl install] \
--openssldir=[path to ssl install]/ssl
perl configdata.pm --dump
nmake
nmake test
nmake install
Build ngtcp2
Build Command:
cmake -B build/ngtcp2
-DCMAKE_INSTALL_PREFIX=[path to ngtcp2 install]
-DCMAKE_BUILD_TYPE=DEBUG
-DENABLE_OPENSSL=ON
-DOPENSSL_ROOT_DIR=[path to ssl install]
-DLIBNGHTTP3_INCLUDE_DIR=[path to libngtcp3 install]/include
-DLIBNGHTTP3_LIBRARY=[path to libngtcp3 install]/lib
-DENABLE_STATIC_LIB=ON
-DENABLE_SHARED_LIB=OFF
-DBUILD_TESTING=OFF
cmake --build [path to ngtcp2 install] --config=DEBUG
cmake --install [path to ngtcp2 install] --config=DEBUG
Build curl
Build Command:
cmake -B [path to curl install]
-DCMAKE_INSTALL_PREFIX= [path to curl install] \
-DCMAKE_BUILD_TYPE= Debug \
-DBUILD_SHARED_LIBS= OFF \
-DBUILD_STATIC_LIBS= ON \
-DBUILD_TESTING= OFF \
-DCURL_CA_BUNDLE= "./cacert.pem_path" \
-DCURL_USE_OPENSSL= ON \
-DOPENSSL_ROOT_DIR= [path to ssl install] \
-DCURL_USE_LIBPSL= ON \
-DLIBPSL_INCLUDE_DIR= [path to libpsl install]/include \
-DLIBPSL_LIBRARY= [path to libpsl install]/lib/psl.lib \
-DLIBPSL_CFLAGS= -DPSL_API= \
-DNGHTTP3_INCLUDE_DIR= [path to nghttp3 install]/include \
-DNGHTTP3_LIBRARY= [path to nghttp3 install]/lib/nghttp3.lib \
-DNGHTTP3_CFLAGS= -DNGHTTP3_STATICLIB= \
-DUSE_NGTCP2= ON \
-DNGTCP2_INCLUDE_DIR= [path to ngtcp2 install]/include \
-DNGTCP2_LIBRARY= [path to ngtcp2 install]/lib/ngtcp2.lib \
-DNGTCP2_CFLAGS= -DNGTCP2_STATICLIB=
Issue Explanation
The curl_openssl_check_quic function in CMakeLists.txt fails during compilation because crypt32.lib is not linked. This occurs when:
ngtcp2 and curl are both statically linked to quictls/openssl.
Static linking does not automatically resolve Windows-specific dependencies like crypt32, which provides cryptographic APIs (e.g. SSL_set_quic_use_legacy_codepoint)
bagder
changed the title
Requesting PR to Fix Issues When Statically Linking ngtcp2 and quictls/openssl
Statically linking ngtcp2 and quictls/openssl on Windows
Apr 19, 2025
I did this
To compile curl on Windows with MSVC and statically link all dependencies, I used these steps:
Build Command:
Build Command:
Build Command:
Issue Explanation
The curl_openssl_check_quic function in CMakeLists.txt fails during compilation because crypt32.lib is not linked. This occurs when:
ngtcp2 and curl are both statically linked to quictls/openssl.
Static linking does not automatically resolve Windows-specific dependencies like crypt32, which provides cryptographic APIs (e.g. SSL_set_quic_use_legacy_codepoint)
I fixed this probrem:
Commit: jixinqi@f9252a6
I expected the following
No response
curl/libcurl version
PS Z:\curl-builder> Z:\curl-builder__install\curl\Debug\bin\curl.exe -V
curl 8.13.1-DEV (Windows) libcurl/8.13.1-DEV quictls/3.1.7 zlib/1.3.1.1-motley libpsl/0.21.5 nghttp2/1.65.90 ngtcp2/1.11.90 nghttp3/1.8.90
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS HSTS HTTP2 HTTP3 HTTPS-proxy IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP UnixSockets
operating system
windows 11
The text was updated successfully, but these errors were encountered: