Skip to content

Instantly share code, notes, and snippets.

@r-lyeh-archived
Last active June 15, 2020 09:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-lyeh-archived/f1559093e6b9517444e4 to your computer and use it in GitHub Desktop.
Save r-lyeh-archived/f1559093e6b9517444e4 to your computer and use it in GitHub Desktop.
build curl+ssl on windows

tutorial 1

http://stackoverflow.com/questions/34114025/linking-curl-as-a-static-lib-windows?noredirect=1#comment55977748_34114025

tutorial 2

How to build cURL static library with SSL support on Windows

This is a short note about building cURL with SSL support on Windows

Tools required

  • cURL source: Download latest cURL source from here.
  • Microsoft Visual C++ 2008 or 2010 Express Edition: It looks like 2008 Express Edition is no longer available, but 2010 Express Edition can be downloaded from here.
  • Win32 OpenSSL:
    • Download Win32 OpenSSL installer and Visual Studio redistributable from here - these are Win32 OpenSSL v1.0.1e and Visual C++ 2008 Redistributables at the time of this writing.
  • Install Win32 OpenSSL; by default it installs to C:\OpenSSL-Win32.
  • Install Visual C++ 2008 redistributable.

Building cURL

  • Run Visual Studio 2008 Command Prompt from Start Menu > All Programs > Microsoft Visual C++ 2008 Express Edition > Visual Studio Tools. Or, Visual Studio 2010 Command Prompt if you're using Visual C++ 2010.

  • Navigate to winbuild sub-directory in cURL source directory, and issue following command:

  • nmake /f Makefile.vc mode=static WITH_SSL=static WITH_DEVEL=C:\OpenSSL-Win32 VC=X ENABLE_SSPI=no ENABLE_IDN=no ENABLE_WINSSL=no DEBUG=no MACHINE=x86 GEN_PDB=no ENABLE_IPV6=yes

  • Note: In VC=X, replace X with 9 for Visual C++ 2008 or 10 for Visual C++ 2010.

  • Once build is complete, cURL static libraries would be copied to builds sub-directory in cURL source directory.

  • Additionally, define CURL_STATICLIB in your app before linking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment