Visual Studio 2015 compilation builds a libcurl static library that supports the HTTPS protocol

Source: Internet
Author: User
Tags microsoft c

Because previous work required the use of the Libcurl Open source project library after various studies found that the HTTPS protocol could not be used

Later through a variety of documents, found to need OpenSSL support, this need to download and build their own lib or DLL

As for the build of OpenSSL I will not do too much introduction directly paste an installation of the tutorial link you can refer to the following

Http://www.cnblogs.com/yangyquin/p/5284530.html

Download Curl Open source project to GitHub Https://github.com/curl/curl

Clone it and go into curl. Create a new "Deps" folder in the current directory

Copy the three folders of the previously generated static or dynamic OpenSSL bin, include, and Lib to the "Deps" folder

Then run the Buildconf.bat file

Then run the Visual Studio 2015 command-line tool to remember that the administrator is running

The first entry will be in C:\Program Files (x86) \microsoft Visual Studio 14.0> here

We need to get into C:\Program Files (x86) \microsoft Visual Studio 14.0\vc\bin

Command Line Input

  

Enter on Enter

Then console input

Vcvars32.bat

This time we need to get into the Curl\winbuild directory we just downloaded.

Because my curl download was put on the E disk here I need to switch to e-drive and CD to E:\OpenSource\curl\winbuild

CD curl-src \ Winbuild

You can then call nmake/f MAKEFILE.VC with the options you want (see below).
This version will be located in the top-level src directory and generate \ Directory
A directory that is named using the options provided to the NMAKE call.

nmake/f makefile.vc mode = <static or dll> <options>

where <options> is one or more:
VC = <6,7,8,9,10,11,12,14,15>-VC version
With_devel = < path >-Path to Development files (ssl,zlib, etc.)
The default is sibling directory representative:.. /deps
access to the library via http://windows.php.net/downloads/php-sdk/deps/
unzip them into the Deps folder.
With_ssl = <dll or static>-enable OpenSSL support, DLL or static
WITH_NGHTTP2 = <dll or static>-enable HTTP/2 support, DLL or static
With_mbedtls = <dll or static>-enable MBEDTLS 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, default is Yes
Enable_ipv6 = < Yes or no >-enable IPV6, default is Yes
ENABLE_IDN = < Yes or no >-enable Windows IDN API, default Yes
you need Windows Vista or a later version, or install from the following location:
https://www.microsoft.com/downloads/details.aspx? familyid=ad6158d7-ddba-416a-9109-07607425a815
Enable_winssl = < Yes or no >-enable native Windows SSL support, default Yes
gen_pdb = < Yes or no >-build program Database (debug symbol for release version)
debug = < Yes or no >-debug Version
Machine = <x86 or x64>-Target schema (default = x86)

Static links for Microsoft C RunTime (CRT):
==============================================
If you use mode = Static,nmake will create and link to the static build
Libcurl but not * static CRT. If you must force NMAKE to link in
Static CRT by passing rtlibcfg = static. Usually you should not use it
option, and NMAKE defaults to the DLL CRT. Rtlibcfg rarely used
So very little testing

The above is some of the parameters required for compiling

Enter the following code at the command line to return to

nmake/f makefile.vc mode=static vc=14 with_ssl=static with_devel=e:\opensource\curl\deps\ DEBUG=yes  ENABLE_IDN= No

Of course want to compile others can be modified according to the parameters themselves

This is the static support library after adding OpenSSL libcurl access to the HTTPS Web site

But the size of the support library is a bit large. 21Mb multi-compiled files under the Builds folder

Visual Studio 2015 compilation builds a libcurl static library that supports the HTTPS protocol

Related Article

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.