libcurl 编译指南(支持SSL)
来源:互联网 发布:gps数据解析c程序 编辑:程序博客网 时间:2024/05/28 16:23
首先,从libcurl官网下载源码:https://curl.haxx.se/download.html,我下载的是curl-7.48.0版本。其次,确认已经安装了VS2008或者其他版本的Visual Studio。
由于之前使用VS编译的libcurl库不支持SSL,这次改用nmake来编译。经过测试,nmake编译出来的库是支持SSL的。至于VS编译出来的为什么不行(配置了预处理也不行),暂时无从知晓。下面就介绍如何使用nmake来编译出支持SSL的静态库:
打开 Visual Studio 2008命令提示,cd 到 curl-7.48.0下的winbuild目录,然后按照winbuild目录下BUILD.WINDOWS.txt文件的说明,输入:nmake /f makefile.vc mode=static VC=9 ENABLE_IDN=no debug=no,然后回车开始编译!值得注意一下:最好指定VC的版本号(VS2008的VC版本是9.0),否则外部程序编译时,可能会出现“无法解析的外部符号”的提示错误。待编译完成后,在 curl-7.48.0\builds\libcurl-vc7-x86-release-static-ipv6-sspi-winssl 目录下,就是刚才编译好的lib库了。
======================== 编译选项 ===========================
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 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: https://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) Static linking of Microsoft's C RunTime (CRT): ============================================== If you are using mode=static nmake will create and link to the static build of libcurl but *not* the static CRT. If you must you can force nmake to link in the static CRT by passing RTLIBCFG=static. Typically you shouldn't use that option, and nmake will default to the DLL CRT. RTLIBCFG is rarely used and therefore rarely tested. When passing RTLIBCFG for a configuration that was already built but not with that option, or if the option was specified differently, you must destroy the build directory containing the configuration so that nmake can build it from scratch. Legacy Windows and SSL ====================== When you build curl using the build files in this directory the default SSL backend will be WinSSL (Windows SSPI, more specifically Schannel), the native SSL library that comes with the Windows OS. WinSSL in Windows <= XP is not able to connect to servers that no longer support the legacy handshakes and algorithms used by those versions. If you will be using curl in one of those earlier versions of Windows you should choose another SSL backend like OpenSSL.
阅读全文
0 0
- libcurl 编译指南(支持SSL)
- libcurl 编译指南(支持SSL)
- VC++ 编译libcurl 支持SSL,GZIP
- VC++ 编译libcurl 支持SSL,GZIP
- VC++ 编译libcurl 支持SSL,GZIP
- libcurl如何支持ssl
- Libcurl库支持SSL协议的编译方法
- libcurl编译,支持https
- libcurl编译增加ssl功能
- vs2015编译libcurl+ssl+zlib(MT静态版)
- curL 下载Https 网页的内容 编译的libcurl 需支持ssl
- ios5.1编译带SSL的libcurl
- 使用VS编译libcurl库(支持libSSH2和OpenSSL)
- libcurl SSL
- Ubuntu+NDK编译支持HTTPS的libcurl
- 支持sftp协议的libcurl编译
- libcurl 支持 openssl 交叉编译 mips rt5350
- 随笔:交叉编译libcurl库支持HTTPS
- JBPM在Myeclipse中的安装
- 简单描述Spring -- Spring的个人理解
- Xshell快速命令集设置技巧
- JSON.parse()和JSON.stringify()
- matlab和caffe中RGB图像存储顺序
- libcurl 编译指南(支持SSL)
- 网页发起qq聊天\微信聊天
- hdu 3861
- Python pandas 数据框的str列内置的方法详解
- JSON.parse()和JSON.stringify()
- 命令模式
- 判断时间是不是同一周
- [转]Linux下共享库(SO)有关的几个环境变量
- Linux常用命令