how do I compile cURL with openSSL and nghttp2 on Windows x64?
Ok, I was finally able to build Curl on Windows with http/2 support.This is what worked for me, step by step:
- Downloaded "Build Tools for Visual Studio 2017" to be able to build from the command line (provides
nmake
and required Windows SDK libraries and header filtes) - downloaded the latest version of curl, like stated above (
curl-7.56.1.tar.gz
, aka for me the very first one on https://curl.haxx.se/download.html) - extracted it inside
c:/curl
, so I ended up withc:/curl/curl-7.56.1
- read instructions BUILD.WINDOWS.txt inside
c:/curl/curl-7.56.1/winbuild
and proceeded to http://windows.php.net/downloads/php-sdk/deps/ to download the 4 libraries that I needed. I just grabbed the VC15/x86 versions. - created a new folder named "deps" inside
c:/curl/curl-7.56.1
- created the following 3 folders inside
c:/curl/curl-7.56.1/deps
:bin
,lib
, andinclude
- extracted each library I just downloaded in the corresponding 3 folders
- opened Developer Command Prompt for VS 2017
cd c:/curl/curl-7.56.1/winbuild
nmake -f Makefile.vc mode=dll WITH_DEVEL=c:/curl/curl-7.56.1/deps WITH_SSL=dll WITH_NGHTTP2=dll WITH_ZLIB=static WITH_SSH2=dll
- this builds a CURL executable inside one of the subfolders in
c:\curl\curl-7.56.1\builds
- when I first tried running CURL, it showed an error saying missing libssl-1_1.dll and libcrypto-1_1.dll, so I had to copy them from
c:\curl\curl-7.56.1\deps\bin
to the same directory where the newly built curl.exe is - Note: since zlib didn't come with a
bin
folder containing any.dll
's, I understand why I had to mark zlib as static with theWITH_ZLIB=static
flag. What I don't get is why I had to manually move the openssl.dll
's in the new directory. Any thoughts?
PS: thank you Daniel for pointing me in the right direction. I didn't even notice the /winbuild
directory.
PPS: As you can probably tell, I had no idea what I've been doing 90% of the time. Probably why it took me 5 days to figure it out ;)