VS2019 libcurl 64位编译支持openssl+zlib

一、环境准备:
        新建根目录:libcurl_2019
        新建:libcurl_2019/deps
二、依赖库下载:
        https://windows.php.net/downloads/php-sdk/deps/vc15/x64/
        openssl-1.1.1g-vc15-x64.zip,zlib-1.2.11-vc15-x64.zip
        分别解压到:libcurl_2019/deps
三、开始编译:
        下载libcurl:https://curl.se/download/  curl-7.70.0.tar.gz
        解压到当前文件夹
        进入根目录:curl-7.70.0
        双击执行:buildconf.bat
        开始菜单找到:x64 Native Tools Command Prompt for VS 2019
        cd到libcurl_2019/curl-7.70.0/winbuild

nmake /f Makefile.vc VC=15 WITH_SSL=dll WITH_ZLIB=static MACHINE=x64 mode=static RTLIBCFG=static


        等待编译完成,结果在builds目录下
四、使用libcurl
        新建项目
        项目根目录下:
                include
                        curl
                lib
                        libcrypto.lib
                        libcurl_a.lib
                        libssl.lib
                        zlib_a.lib
        项目环境:Release x64
        项目属性:
                【VC++目录】
                        包含目录:./include
                        库目录:./lib
                【C/C++ 预处理器】 预处理器定义:CURL_STATICLIB
                【C/C++ 代码生成】 运行库:MT
                【链接器 输入】附加依赖项:libcurl_a.lib,libcrypto.lib,libssl.lib,zlib_a.lib,Ws2_32.lib,Wldap32.lib,winmm.lib,Crypt32.lib,Normaliz.lib
        编译可通过

你可能感兴趣的:(C/C++,c++,libcurl,64,openssl,zlib)