VC + + compiler Libcurl support Ssl,gzip

Source: Internet
Author: User
Tags ssl certificate visual studio 2010

Because the online download of Libcurl does not support gzip, had to build their own, during a lot of detours, the following is the final record of success.

The environment I am using Visual Studio 2010, Windows 7

1 Downloading files

1.1 Libcurl

Download Page http://curl.haxx.se/download.html

Http://curl.haxx.se/download/curl-7.26.0.zip

1.2 zlib

Download Page http://sourceforge.net/projects/libpng/files/zlib/

Http://sourceforge.net/projects/libpng/files/zlib/1.2.5/zlib125.zip/download

(Special reminder, do not use the 1.2.7 version of the compilation, after use found that the compilation method and file name are different)

1.3 OpenSSL

Download Page http://www.openssl.org/source/

Http://www.openssl.org/source/openssl-1.0.0c.tar.gz

(Special reminder, do not recommend 1.0.1c, although it can be compiled successfully, but can not bypass the SSL certificate, I do not know why, wasted a lot of my time)

Compiling OpenSSL also needs to download ActivePerl

Official Download 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 Extracting and installing files

2.1 ActivePerl installation, double click directly next, the default setting to the end.

2.2 zlib OpenSSL Libcurl are decompressed separately, with three of them in the same level directory.

For example: D:\User\Dewei\TestCurl\curl-7.26.0, D:\User\Dewei\TestCurl\openssl-1.0.0c, D:\User\Dewei\TestCurl\zlib-1.2.5

3 compilation process

3.1 zlib Compilation

Open ZLIB-1.2.5/OLD/VISUALC6/ZLIB.DSW with vs2010, choose Dll_release Compile, compile the generated zlib-1.2.5/old/visualc6/win32_dll_release/ Zlib1.lib Copy to the Curl-7.26.0/lib directory, rename to Zdll.lib (Note that this file name must be).

3.2 OpenSSL compilation

Open the CMD,CD to the openssl-1.0.0c directory;

Run the command Perl Configure Vc-win32

Run Ms\do_ms.bat again

Run the C:\Program Files (x86) \microsoft Visual Studio 10.0\vcvars32.bat

Run command nmake-f Ms/ntdll.mak

Reference: Openssl-1.0.0c/install. W32

3.3 Compiling curl-7.26.0

Create a new Release.bat in the Curl-7.26.0/lib directory and enter the following:

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

Save, and then run.

Wait for a while, you can go to the Curl-7.26.0\lib\release-dll-ssl-dll-zlib-dll directory copy file Libcurl_imp.lib and Libcurl.dll!

Reference: Curl-7.26.0/docs/install

VC + + compiler Libcurl support Ssl,gzip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.