libcurl+zlib+openssl编译安装

在windows下源码安装libcurl并开启zlib和openssl支持,可以直接调出cmd后切换到curl源码目录:
Then you can call nmake /f Makefile.vc with the desired options (see below).
The builds will be in the top src directory, builds\ directory, in
a directory named using the options given to the nmake call.

nmake /f Makefile.vc mode=

where is one or many of:
VC=<6,7,8,9,10,11,12,14> - VC versions
WITH_DEVEL= - Paths for the development files (SSL, zlib, etc.)
WITH_SSL= - Enable OpenSSL support, DLL or static
WITH_MBEDTLS= - Enable mbedTLS support, DLL or static
WITH_CARES= - Enable c-ares support, DLL or static
WITH_ZLIB= - Enable zlib support, DLL or static
WITH_SSH2= - Enable libSSH2 support, DLL or static
ENABLE_SSPI= - Enable SSPI support, defaults to yes
ENABLE_IPV6= - Enable IPv6, defaults to yes
ENABLE_WINSSL= - Enable native Windows SSL support, defaults to yes
GEN_PDB= - Generate Program Database (debug symbols for release build)
DEBUG= - Debug builds
MACHINE= - Target architecture (default is x86)
按照winbuild下给的BUILD.WINDOWS.txt提示,将zlib、openssl的先编译好后,再按照需要在zlib、openssl中创建include、lib文件夹,移入相应的头文件,然后执行编译。
编译时可能会提示缺少zlib_a.lib,需要将zlib编译生成的zlibwapi.lib改下名字。
有点麻烦,于是转向了linux。
首先去各自官网下好libcurl、zlib、openssl源码后,
1)configure 2)make 3)make instsall
大功告成
如果configure提示出错
checking run-time libs availability… failed
configure: error: one or more libs available at link-time are not available run-time. Libs used at link-time: -lidn -lssh2 -lssl -lcrypto -lssl -lcrypto -ldl -lz
就需要找到这些库的位置
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib64:$LD_LIBRARY_PATH
重新configure

参考:
1.http://www.codepool.biz/build-use-libcurl-vs2015-windows.html
2.http://blog.csdn.net/pony12/article/details/43792287

你可能感兴趣的:(C++)