libcurl源代码编译

最近闲来无事,发现libcurl源代码编译方式要与时俱进。在此整理一下libcurl在windows环境中源代码编译过程。

        首先,从libcurl的官网上面下载源代码(不要问我怎么下载),我下载的版本是curl-7.45.0。

        其次,解压压缩包后进入文件夹winbuild,英文好的直接看BUILD.WINDOWS.txt。不想看英文的就打开vs的Visual Studio Command Prompt命令,进入到curl-7.45.0\winbulid目录,执行nmake -f makefile.vc mode=dll vc=10就可以了。

最后,编译好的文件(lib、dll、exe、头文件)存在目录curl-7.45.0\builds中。

俗话说有图有真相,上图


编译模式有多种,参考BUILD.WINDOWS.txt或者如下

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=<static or dll> <options>  --静态库还是动态库


where <options> is one or many of:
  VC=<6,7,8,9,10,11,12,14>     - VC versions --vc版本
  WITH_DEVEL=<path>            - Paths for the development files (SSL, zlib, etc.)
                                 Defaults to sibbling directory deps: ../deps
                                 Libraries can be fetched at http://windows.php.net/downloads/php-sdk/deps/
                                 Uncompress them into the deps folder.
  WITH_SSL=<dll or static>     - Enable OpenSSL support, DLL or static
  WITH_CARES=<dll or static>   - Enable c-ares support, DLL or static
  WITH_ZLIB=<dll or static>    - Enable zlib support, DLL or static
  WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static
  ENABLE_SSPI=<yes or no>      - Enable SSPI support, defaults to yes
  ENABLE_IPV6=<yes or 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, or installation from:
                                 http://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815
  ENABLE_WINSSL=<yes or no>    - Enable native Windows SSL support, defaults to yes
  GEN_PDB=<yes or no>          - Generate Program Database (debug symbols for release build)
  DEBUG=<yes or no>            - Debug builds
  MACHINE=<x86 or x64>         - Target architecture (default is x86)


如果对你有帮助,那就是你好我好大家好;如果对你有困扰,呵呵(你懂的)。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值