由于网上下载的 libcurl 不支持 gzip,只好自己动手编译,期间走了很多弯路,下面是最终成功的记录。

我所使用的环境 Visual Studio 2010 、 Windows 7 64 bit

1 下载文件

1.1 libcurl

下载页面 http://curl.haxx.se/download.html

下载地址 http://curl.haxx.se/download/curl-7.26.0.zip

1.2 zlib

下载页面 http://sourceforge.net/projects/libpng/files/zlib/

下载地址 http://sourceforge.net/projects/libpng/files/zlib/1.2.5/zlib125.zip/download

(特别提醒,不要使用1.2.7版编译,使用后发现编译的方法和文件名都不同了)

1.3 openssl

下载页面 http://www.openssl.org/source/

下载地址 http://www.openssl.org/source/openssl-1.0.0c.tar.gz

(特别提醒,不建议用1.0.1c,虽可编译成功,但无法绕过SSL证书,不知其原因,浪费了我不少时间)

编译openssl还需下载ActivePerl

官方下载 http://www.activestate.com/activeperl/downloads

下载地址:http://downloads.activestate.com/ActivePerl/releases/5.16.0.1600/ActivePerl-5.16.0.1600-MSWin32-x86-295879.msi

X64下载地址:http://downloads.activestate.com/ActivePerl/releases/5.16.0.1600/ActivePerl-5.16.0.1600-MSWin32-x64-295879.msi

2 解压及安装文件

2.1 ActivePerl安装,双击直接下一步,默认设置到底。

2.2 zlib openssl libcurl分别解压,他们三个在同一级目录。

例如:D:UserDeweiTestCurlcurl-7.26.0、D:UserDeweiTestCurlopenssl-1.0.0c、D:UserDeweiTestCurlzlib-1.2.5

3 编译过程

3.1 zlib编译

用vs2010打开zlib-1.2.5/old/visualc6/zlib.dsw,选择DLL_Release编译,把编译生成的zlib-1.2.5/old/visualc6/Win32_DLL_Release/ zlib1.lib 复制到curl-7.26.0/lib目录下,重命名为 zdll.lib (注意必须为此文件名) 。

3.2 openssl编译

打开cmd,cd到openssl-1.0.0c目录下;

运行命令 perl Configure VC-WIN32

再运行 msdo_ms.bat

再运行 “C:Program Files (x86)Microsoft Visual Studio 10.0vcvars32.bat”

运行命令 nmake -f ms/ntdll.mak

参考资料:openssl-1.0.0c/INSTALL.W32

3.3 编译curl-7.26.0

在curl-7.26.0/lib目录下新建release.bat,输入以下内容

call “C:/Program Files/Microsoft Visual Studio 10.0/VC/bin/vcvars32.bat”
set CFG=release-dll-ssl-dll-zlib-dll
set OPENSSL_PATH=../../openssl-1.0.0c
set ZLIB_PATH=../../zlib-1.2.5
nmake -f Makefile.vc10

保存,然后运行。

等待一会儿,就可以到 curl-7.26.0librelease-dll-ssl-dll-zlib-dll 目录下拷文件 libcurl_imp.lib和libcurl.dll 啦!

参考资料:curl-7.26.0/docs/INSTALL

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

Usage: nmake /f makefile.vc6 CFG=<config> <target>

where <config> is one of:

release - release static library

release-ssl - release static library with ssl

release-zlib - release static library with zlib

release-ssl-zlib - release static library with ssl and zlib

release-ssl-ssh2-zlib - release static library with ssl, ssh2 and zlib

release-ssl-dll - release static library with dynamic ssl

release-zlib-dll - release static library with dynamic zlib

release-ssl-dll-zlib-dll - release static library with dynamic ssl and dynam

ic zlib

release-dll - release dynamic library

release-dll-ssl-dll - release dynamic library with dynamic ssl

release-dll-zlib-dll - release dynamic library with dynamic zlib

release-dll-ssl-dll-zlib-dll - release dynamic library with dynamic ssl and dyna

mic zlib

debug - debug static library

debug-ssl - debug static library with ssl

debug-zlib - debug static library with zlib

debug-ssl-zlib - debug static library with ssl and zlib

debug-ssl-ssh2-zlib - debug static library with ssl, ssh2 and zlib

debug-ssl-dll - debug static library with dynamic ssl

debug-zlib-dll - debug static library with dynamic zlib

debug-ssl-dll-zlib-dll - debug static library with dynamic ssl and dynamic

zlib

debug-dll - debug dynamic library

debug-dll-ssl-dll - debug dynamic library with dynamic ssl

debug-dll-zlib-dll - debug dynamic library with dynamic zlib1

debug-dll-ssl-dll-zlib-dll - debug dynamic library with dynamic ssl and dynami

c zlib

本文出自 王牌软件,转载时请注明出处及相应链接。

本文永久链接: http://www.softwareace.cn/?p=525

http://www.yaoguangkeji.com/a_W3V5MKwb.html

VC++ 编译libcurl 支持SSL,GZIP(有脚本)的更多相关文章

  1. VC++ 编译libcurl 支持SSL,GZIP

    由于网上下载的 libcurl 不支持 gzip,只好自己动手编译,期间走了很多弯路,下面是最终成功的记录. 我所使用的环境 Visual Studio 2010 . Windows 7 64 bit ...

  2. 编译libcurl支持https协议

    编译与安装参考:http://www.cnblogs.com/openiris/p/3812443.html 注意事项:先下载安装完nasm和perl再打开控制台(需要将nasm安装路径添加到Path ...

  3. 编译安装haproxy开启支持SSL

    1.下载程序包 # wget http://www.haproxy.org/download/1.7/src/haproxy-1.7.5.tar.gz # tar xvf haproxy-1.7.5. ...

  4. 迁移到MSYS2 与 Qt 工具链注意的几个事情(g++在链接时,符号依赖项查找遵循从左至右的顺序,但qmake会自动合并造成错误。使用脚本给Mingw32-make创造出一个局部的VC编译环境)

    Microsoft Visual Studio 2015社区版提供了强大的开发体验,且 Qt 提供了预编译版本.然而,由于客户提出兼容Windows XP ~ Windows 8.1 这样宽泛的环境要 ...

  5. nginx编译安装支持lua脚本

    一.准备编译环境 1.操作系统:CentOS7.6 2.安装编译所需安装包 yum install gcc pcre pcre-devel zlib zlib-devel openssl openss ...

  6. windows 下编译libcurl

    因为linux平台采用了libcurl,有一个程序移植到到windows平台,再linux采用libcurl.在windows下准备也采用该库.在网上搜索了几位同行写的,步骤上面有缺失. 本文将以详细 ...

  7. 【转】linux 编译安装nginx,配置自启动脚本

    linux 编译安装nginx,配置自启动脚本 本文章来给各位同学介绍一篇关于linux 编译安装nginx,配置自启动脚本教程,希望有需要了解的朋友可一起来学习学习哦. 在公司的suse服务器装ng ...

  8. VC++编译MPIR 2.7.0

    目录 第1章编译    2 1.1 简介    2 1.2 下载    3 1.3 解决方案    4 1.4 创建项目    5 1.5 复制文件树    6 1.6 不使用预编译头文件    8 ...

  9. linux 编译安装nginx,配置自启动脚本

    本文章来给各位同学介绍一篇关于linux 编译安装nginx,配置自启动脚本教程,希望有需要了解的朋友可一起来学习学习哦. 在公司的suse服务器装nginx,记录下安装过程: 参照这篇文章:Linu ...

随机推荐

  1. 【50.26%】【hdu 5907】Find Q

    Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others) 问题描述 Byteasar迷恋上了 ...

  2. 我的嵌入式Qt开发第一课——基于BBB和hmc5843三轴电子罗盘

    几次想照着课本系统地学习Qt,但我发现还是有详细问题驱动时学习比較快. 于是我给自己设定了这个任务: 读取HMC5843的三轴磁场强度值,计算出角度,并把角度用直观形式显示在图形界面上. 这里面涉及到 ...

  3. 基于 MySQL 5.6 keepalived的双主搭建

    环境介绍: 说明 IP 节点1 192.168.56.56 节点2 192.168.56.57 w_ip 192.168.56.6 安装keepalived tar -zxvf keepalived- ...

  4. [Vue] Conditionally Render DOM Elements in Vue.js (v-if v-else v-show)

    You can use v-if and v-else to display content based on assertions on your data. Similarly, v-show c ...

  5. 曼德勃罗(Mandelbrot)集合与其编程实现

    一.从科赫雪花谈起 设想一个边长为1的等边三角形(例如以下图所看到的).取每边中间的三分之中的一个,接上去一个形状全然类似的但边长为其三分之中的一个的三角形,结果是一个六角形.如今取六角形的每个边做相 ...

  6. iOS 项目的文件夹结构能看出你的开发经验

    近期有师弟去面试iOS开发,他谈论到,面试官既然问他怎么分文件夹结构的,并且还详细问到每一个子文件夹的文件名称. 文件夹结构确实非常重要.面试官问他这些无疑是想窥探他的开发经验.清晰的文件夹结构,可让 ...

  7. CSDN code使用教程之git使用方法具体解释

          首先须要下载GITclient.http://git-scm.com/downloads. . . 然后再code.csdn.net上面创建一个项目,假设 你的项目已经存在.那么请建立项目 ...

  8. JavaScript经典面试题(二)

    前言: 近年来T行业就业者越来越多,有关于编程行业的高薪工作也变得越来越难找,竞争力越来越大,想要在众多的应聘者当中脱颖而出,面试题和笔试题一定要多加研究和琢磨,以下记录的是自己的面试过程之中遇到的一 ...

  9. 【u127】台阶问题

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 有N级的台阶,你一开始在底部,每次可以向上迈最多K级台阶(最少1级),问到达第N级台阶有多少种不同方式 ...

  10. Linux 增值服务中删除,自己主动和国家执行

    CAMS 在自己主动参加相关的服务安装过程.在最后的安装过程中会提示用户是否启动该服务,这样的服务才能生效,需要注意的是一个服务并不意味着系统启动过程中被添加到该服务后,会自己主动执行,只可用于ser ...