This is a short note about building cURL with SSL support on Windows.
Tools required:
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 areWin32 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
Once build is complete, cURL static libraries would be copied to
builds
sub-directory in cURL source directory.
6 COMMENTS:
Anonymous said...-
-
4:29 PM
Anonymous said...
-
-
2:10 PM
Anonymous said...
-
-
4:07 AM
Anonymous said...
-
-
11:12 PM
Anonymous said...
-
-
11:17 PM
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.
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.
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?
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
Found the answer.
Need to add CURL_STATICLIB to project to avoid the linker error. Thanks for the tutorial
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