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:
  1. cURL source: Download latest cURL source from here.
  2. 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.
  3. Win32 OpenSSL:
    1. Download Win32 OpenSSL installer and Visual Studio redistributable from here - these areWin32 OpenSSL v1.0.1e and Visual C++ 2008 Redistributables at the time of this writing.
    2. Install Win32 OpenSSL; by default it installs to C:\OpenSSL-Win32.
    3. Install Visual C++ 2008 redistributable.

Building cURL:
  1. 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.
  2. 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.

6 COMMENTS:
Anonymous  Anonymous said...

I'm using Visual Studios 2012. How do I do this in VS2012? 'Navigate to winbuild sub-directory in cURL source directory' I don't have such thing like a winbuild directory.

4:29 PM
Anonymous  Anonymous said...

Did you download cURL from here:
http://curl.haxx.se/download.html

Download curl-7.33.0.tar.gz (at the time of this writing) from the above link. Extract it to a directory in your computer.

Launch Visual Studio 2012 Command Prompt by following steps mentioned in these links:
http://neverindoubtnet.blogspot.in/2012/10/add-visual-studio-command-prompt-to.html
http://blogs.msdn.com/b/vcblog/archive/2013/04/19/finding-the-visual-studio-command-prompts-in-visual-studio-2012.aspx

Once Visual Studio 2012 Command Prompt is up, you can use "cd" command to change directory to "winbuild" directory in cURL source.

2:10 PM
Anonymous  Anonymous said...

Hi, I'm on Win8 with Visual 2012 Express Edition and I followed steps, but in winbuild when I run Nmake I get error:nmake: fatal error U1073: don't know how to make VC12

any help?

4:07 AM
Anonymous  Anonymous said...

Hi
I get a linking error "unresolved external symbol __imp__curl_easy_init"
when following your step and using the lib and headers.
How can I get around this ?
Thanks

11:12 PM
Anonymous  Anonymous said...

Found the answer.
Need to add CURL_STATICLIB to project to avoid the linker error. Thanks for the tutorial

11:17 PM
Anonymous  Anonymous said...

Thanks a lot, 

After trying to make build it through the IDE and spending tons of hours in many attempts to get it compiled the way I liked, this worked flawlessly. At the first try... I hope I have done this before :\

Thanks once again,
David.

5:42 AM


转载自:

http://swatrant.blogspot.in/2013/06/how-to-build-curl-static-library-with.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值