1、代码下载:
2、解压
3、打开编译环境
x86选择:Developer Command Prompt
x64选择:x64 Native Tools Command Prompt for VS 2022
4、定位路径到curl-8.12.1\winbuild
5、编译
set WINBUILD_ACKNOWLEDGE_DEPRECATED=yes
x86:nmake /f Makefile.vc mode=static
x64 :nmake /f Makefile.vc mode=static MACHINE=x64
6、结果目录
x86:curl-8.12.1\builds\libcurl-vc-x86-release-static-ipv6-sspi-schannel
x64:curl-8.12.1\builds\libcurl-vc-x64-release-static-ipv6-sspi-schannel
7、包含curl头文件的工程需定义宏:CURL_STATICLIB
8、链接找不到符号则加上系统库:
ws2_32.lib wldap32.lib advapi32.lib crypt32.lib Normaliz.lib Crypt32.lib