[编译ZLIB]
下载最新版zlib解压
https://github.com/madler/zlib
进入到路径zlib-develop\contrib\vstudio打开对应vs项目 编译zlibvc项目
更改生成类型为: 静态LIB
C/C++配置下
运行库MD改为:MT
汇编程序输出改为: 无列表
编译成功生成后的路径contrib\vstudio\vc17\x64\ZlibDllRelease\zlibwapi.lib
将生成名改为zlib_a.lib
将zlib目录下的zlib.h和zconfig.h头文件全部拷贝到curl-8.12.1\include

zlib_a.lib拷贝到curl-8.12.1\winbuild
zlib生成的X64包拷贝到curl-8.12.1\winbuild

[编译openssl]
OpenSSL 3.14版本使用VS编译_openssl 3 库 vs 编译 failure! makefile wasn't produce-优快云博客
[编译curl-7.67.0]
https://curl.haxx.se/windows/
由于openssl.lib最新版已改名需要修改文件MakefileBuild.vc 131行
SSL_LIBS = libssl.lib libcrypto.lib
!ELSE
SSL_LIBS = libssl.lib libcrypto.lib
复制zlib_a.lib 和libcrypto.lib\libssl.lib到curl根目录winbuild下 可修改Makefile.vc文件中MD为MT
vs命令切换到curl-7.67.0\winbuild下根据配置运行命令生成libcurl.lib到builds文件夹下
nmake /f Makefile.vc mode=static WITH_SSL=static WITH_ZLIB=static VC=19 ENABLE_OPENSSL_AUTO_LOAD_CONFIG=yes ENABLE_WINSSL=no ENABLE_SSPI=no ENABLE_IPV6=yes DEBUG=no MACHINE=x86 WINBUILD_ACKNOWLEDGE_DEPRECATED=yes ENABLE_IDN=yes GEN_PDB=no RTLIBCFG=static
(32位带zlib版暂无法编译通过)
nmake /f Makefile.vc mode=static WITH_SSL=static WITH_ZLIB=static VC=19 ENABLE_OPENSSL_AUTO_LOAD_CONFIG=yes ENABLE_WINSSL=no ENABLE_SSPI=no ENABLE_IPV6=yes DEBUG=no MACHINE=x64 WINBUILD_ACKNOWLEDGE_DEPRECATED=yes ENABLE_IDN=yes GEN_PDB=no RTLIBCFG=static
where <options> is one or many of:
VC=<6,7,8,9,10,11,12,14,15> - VC versions - VC version. 6 or later.
- `WITH_DEVEL=<path>` - Paths for the development files (SSL, zlib, etc.)
Defaults to sibling directory: `../deps`
- `WITH_SSL=<dll/static>` - Enable OpenSSL support, DLL or static
- `WITH_NGHTTP2=<dll/static>` - Enable HTTP/2 support, DLL or static
- `WITH_MSH3=<dll/static>` - Enable (experimental) HTTP/3 support, DLL or static
- `WITH_MBEDTLS=<dll/static>` - Enable mbedTLS support, DLL or static
- `WITH_WOLFSSL=<dll/static>` - Enable wolfSSL support, DLL or static
- `WITH_CARES=<dll/static>` - Enable c-ares support, DLL or static
- `WITH_ZLIB=<dll/static>` - Enable zlib support, DLL or static
- `WITH_SSH=<dll/static>` - Enable libssh support, DLL or static
- `WITH_SSH2=<dll/static>` - Enable libssh2 support, DLL or static
- `WITH_PREFIX=<dir>` - Where to install the build
- `ENABLE_SSPI=<yes/no>` - Enable SSPI support, defaults to yes
- `ENABLE_IPV6=<yes/no>` - Enable IPv6, defaults to yes
- `ENABLE_IDN=<yes or no>` - Enable use of Windows IDN APIs, defaults to yes
Requires Windows Vista or later
- `ENABLE_SCHANNEL=<yes/no>` - Enable native Windows SSL support, defaults
to yes if SSPI and no other SSL library
- `ENABLE_OPENSSL_AUTO_LOAD_CONFIG=<yes/no>`
- Enable loading OpenSSL configuration
automatically, defaults to yes
- `ENABLE_UNICODE=<yes/no>` - Enable Unicode support, defaults to no
- `GEN_PDB=<yes/no>` - Generate External Program Database
(debug symbols for release build)
- `DEBUG=<yes/no>` - Debug builds
- `MACHINE=<x86/x64/arm64>` - Target architecture (default is x86)
- `CARES_PATH=<path>` - Custom path for c-ares
- `MBEDTLS_PATH=<path>` - Custom path for mbedTLS
- `WOLFSSL_PATH=<path>` - Custom path for wolfSSL
- `NGHTTP2_PATH=<path>` - Custom path for nghttp2
- `MSH3_PATH=<path>` - Custom path for msh3
- `SSH2_PATH=<path>` - Custom path for libssh2
- `SSL_PATH=<path>` - Custom path for OpenSSL
- `ZLIB_PATH=<path>` - Custom path for zlib
1756

被折叠的 条评论
为什么被折叠?



