Recently, I downloaded a CURL library from the Internet. I could n’t start all kinds of errors during use, so I simply compiled it directly.
1. Preparation
A. Download zlib
ZLIB can make HTTP requests support GZIP compression, the address is as follows:
official website: http://zlib.net/
download address: http://zlib.net/zlib-1.2.8.tar.gz
b. Download Openssl
OpenSll uses and supports SSL, such as HTTPS requests.
official website: http://www.opensl.org
download address: http://www.opensl.org/source/opensl-1.0.1f.tar.gz
c. Download curl
official website: http://curl.haxx.se
download address: In http://curl.haxx.se/download.html, select the version you want, I use the latest 7.35.0 hereversion [http://curl.haxx.se/download/curl-7.35.0.tar.gz]
d. Download Activeperll
official website: http://www.activestate.com/activeperl/downloads
Please note that according to your own system version [32,64], select different installation packs [download when the link fails to download]
download address: http://downloads.activestate.com/activeperl/Releases/5.16.0.1600/Activeperll-5.16.0.1600- m86-295879.msi
X64download address: http://downloads.activestate.com/activeperl/Releases/5.16.0.1600/Activeperl-5.16.0.1600- MSWIN32-X64-295879.msi
Compilation method:
A. Install ActivePerl
Double -click to install, just use the default settings.
b. Unzip all the source files, all placed in one directory, for example, I am a house C: \ CURL directory, the directory structure is as follows:
C. Compile ZLIB
From the start menu, select Microsoft Visual Studio 2005> Visual Studio Tools> Visual Studio 2005 Command Prompt, as shown below:
After
, a CMD window will pop up, switch to the directory of ZLIB C: \ Curl \ ZLibxxx, and then enter:
- nmake -f win32/Makefile.msc OBJA=”inffast.obj”
After a while, it will be successfully compiled.
2. Compile Openssl
Switch the current directory to C: \ Curl \ Openssl-1.0.1F, how to enter the following command below:
- ms\32all.bat
Then I started a long compilation. I have waited for 15 minutes before compiling = = $
3. Compile CURLLLIB
Switch the current directory to the directory of CURL C: \ CURL \ CURL-7.35.0 \ lib, and then enter the command in turn:
- set OPENSSL_PATH=..\..\openssl-1.0.1f
- set ZLIB_PATH=..\..\zlib-1.2.8
- nmake -f Makefile.vc8 CFG=release-dll-zlib-dll
Note that Makefile.VC6 is VC6.0 version, VC8 is VC2005, VC9 is VS2008, push in order.
CFG is the configuration compilation results option. The specific content is as follows:
- 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 dynamic 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 dynamic 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 dynamic zlib
- <target> can be left blank in which case all is assumed
- Makefile.vc8(501) : fatal error U1050: please choose a valid configuration “rele
- ase-dll-ssl-dll-zlib-dll ”
- Stop.
Everyone can compile different DLL and lib according to their needs, and I chose to compile two static libraries:
- nmake -f Makefile.vc8 CFG=release-ssl-zlib
- nmake -f Makefile.vc8 CFG=debug-ssl-zlib
and then start to wait for the gorgeous screen to wait ~~~
After a few minutes, I will compile it, and C: \ Curl \ Curl-7.35.0 \ lib \ will have Debug-SSL-ZLIB and Release-SSL-ZLib directory, copy it under the VS project, and then It can be used in configuration.