I needed the ssl features in the curl library. The latest version of curl package with ssl for windows being distributed is 7.15.0. I could have used that version, but my coworkers and I insisted on using the most recent version. So, I had to build curl for myself. Here is how I did it.

How I Built Curl 17.19.3 with OpenSSL and zlib
on Visual C++ 2005 Express
* Download the Compressed Project file to skip everything and simply extract and build.

* For building zlib on Windows with MSVC is straightforward download zlib source from http://www.zlib.net/. Extract files to a certain folder. Open (zlib source folder)\projects\visualc6\zlib.dsw and build.
* For building OpenSSL on Windows with MSVC, refer to previous post.


1. Download and Extraction
Download the curl source files from http://curl.haxx.se/download.html.
Extract the files to a certain folder. I used D:\work\curl-7.19.3


2. Add libraries
Create the following folders in the curl folder
libraries\include\zlib
libraries\include\openssl
Copy zlib.h and zconf.h to (curl source folder)\libraries\include\zlib
Copy (openssl source folder)\include\openssl\*.h to (curl source folder)\libraries\include\zlib

Create the following folders in the curl folder
libraries\lib
Copy libeay32.lib, ssleay32.lib from the OpenSSL build result, and zlib1.lib from the zlib build result to (curl source folder)\libraries\lib


3. Open solution
Among the extracted files, there should be vc6curl.dsw. Visual C++ 2005 Express will complain that the file is no longer supported. Let it update the file to the solution file with the sln file extension and stuff...


4. Change Project Settings
Right click on curllib project and select properties to change curllib's project settings.
Select the appropriate Project Configuration that you are willing to make changes to.
(Probably you would like to change both DLL-Debug and DLL-Release)

Add the following to Configuration Properties -> C/C++ -> General -> Additional Include Directories:
..\libraries\include
..\libraries\include\zlib

Add the following to Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions:
USE_OPENSSL
USE_SSLEAY
HAVE_ZLIB_H

Add the following to Configuration Properties -> Linker -> General -> Additional Library Directories:
..\libraries\lib

Add the following to Configuration Properties -> Linker -> Input -> Additional Dependencies:
zlib1.lib
libeay32.lib
ssleay32.lib


5. Build Solution
Try Ctrl + Alt + F7 and see what happens.





Posted by Dansoonie