1. Download libcurl zip file from this link : https://curl.haxx.se/download.html
2. Unzip to some location say F drive "F:\"
3. Open visual studio 2015 project
4. Choose the configuration Release or Debug whatever you want to build.
Adding Visual Studio Command Prompt
5. Open Visual Studio Command prompt if you don't have this follow these steps
1. In your visual studio project go to Tools-> External tools
2. fill the values required like this:
1. Title : VS Command Prompt //note:you can give any name
2. Command : C:\Windows\System32\cmd.exe
3. Arguments : /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
4. Initial Directory : click the arrow in front and choose Project Directory
3. Then click OK or Apply.
4. After this go to Tools and you will be able to see your tool in the list above External Tools open it.check it should not give any error and should start with your
project Directory location.
6. At the command prompt, change to the Visual C++ installation directory.
(The location depends on the system and the Visual Studio installation, but a typical location is C:\Program Files (x86)\Microsoft Visual Studio version\VC\.)
For example, enter:
cd "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"
Now cmd prompt should be in this folder.
To configure this Command Prompt window for 64-bit x64 command-line builds, at the command prompt, enter:
vcvarsall x64
7. Now in command prompt goto winbuild directory in the unzipped folder for example:
cd "F:\curl-7.49.1\curl-7.49.1\winbuild"
kindly use your directory here this is just for example
Adding nmake to command prompt
8. Give command :
nmake
to check whether it is recognised as a command it should print somethig like this:
Microsoft (R) Program Maintenance Utility Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
it shows nmake is present and if it says:
'nmake' is not recognized as an internal or external command,
operable program or batch file.
Then to add nmake follow these steps:
1. For visual studio 2015 community edition add the following path to your system environment path
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
in the above path there is the nmake command
How to set enviroment path?
1. Press windows key on keyboard and type "edit the system environment variables" and click on it
2. On the window click "Environment Variables".
3. In the system variables click path then click on edit.
4. Click on new and paste this C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
Generating dll and lib files
9. Now for debug build give cmd:
nmake /f Makefile.vc mode=dll VC=14.0 DEBUG=yes MACHINE=x64
for release build give cmd:
nmake /f Makefile.vc mode=dll DEBUG=no MACHINE=x64
This commands should not give any error like fatal error etc. To know more about this options(DEBUG, VC, MACHINE etc) or play around with this options search for nmake
cmd in file at path "F:\curl-7.49.1\curl-7.49.1\winbuild\BUILD.WINDOWS.txt" this is my local path search for yours.
10. This will create some folders at location :
F:\curl-7.49.1\curl-7.49.1\builds
for Debug build:
1. There will be a folder named "libcurl-vc14.0-x64-debug-dll-ipv6-sspi-winssl"
2. It will have three folders bin, include and lib.
3. Open bin and check it should have libcurl_debug.dll.
4. Open lib and check it should have libcurl_debug.lib.
5. If these two things are not there something went wrong.
for Release build :
1. There will be a folder named "libcurl-vc-X64-release-dll-ipv6-sspi-winssl"
2. It will have three folders bin, include and lib.
3. Open bin and check it should have libcurl.dll.
4. Open lib and check it should have libcurl.lib.
5. If these two things are not there something went wrong.
Project settings
11. Now open your visual studio project goto Project then to properties of your project at the end.
1. In configuartion properties -> VC++ Directories -> General -> select Include directories then click on down arrow click on edit,
double click in the top box and then click on ... box and browse to the location of above mentioned include folder and click ok.
2. In configuartion properties -> VC++ Directories -> General -> select Library Directories then click on down arrow click on edit,
double click in the top box and then click on ... box and browse to the location of above mentioned lib folder and click ok.
3. In configuartion properties -> Linker -> Input -> select Additional Dependencies then click on down arrow click on edit,
and in the top box at the end add add full path to the above mentioned libcurl.lib file (libcurl_debug.lib for debug) with in double quotes.
4. Then click Ok and apply this properties and come out of property page.
12. Now copy the above mentioned libcurl.dll (libcurl_debug.dll for debug) and paste in the location where your exe file is present.
13. That's all now you should be able to compile build and Run your project with libcurl installed.
14. In configuartion properties -> C/C++ -> Code Generation -> Runtime Library check whether its multi threaded DLL . I am not sure about this but libcurl needs
multithreaded option.
15. For x86 machine use x86 in place of x64 in the above process .. I haven't verified this.