How To cURL Setup in Visual Studio

Alright so just a little introduction about myself:

Hi, I'm Snayer. I decided to make this tutorial because at the time of my searching, I would have loved to have a resource step by step simple guide (like I intend this to be). Plus I'm bored. Let's begin.

(Shameless Plug) I am just going to have to come out and praise Python for not needing this ridiculous setup, but hey, some people like C++ as a preference.

Downloads:
libCURL - Library for cURL C++. (It's respected Virustotal) 
LIBSASL.dll - Library that curl's main bits operate off. (It's respected Virustotal)
libCurlTest.zip - Project file I used in this tutorial. (It's respected Virustotal)


Let's begin.


  1. Open your Visual Studio

  2. Create or open your wanted C++ Application (I'll be creating a Win32 Application called 'libCurlTest')
    [​IMG][​IMG][​IMG]
  3. Download the libCURL library and extract it to a reasonable location (I picked the desktop)
    [​IMG][​IMG]
  4. Copy the "include" folder from your libCURL folder and paste it inside the main directory of your C++ Project Folder
    [​IMG][​IMG]
  5. Open your C++ Application back up and make sure you have your "Solution Explorer" tab visible infront of you.
    [​IMG]
    Note: If your Solution Explorer is not visible within your VS Porgram, open it up clicking the "View" option in the top-left navigation bar, and clicking "Solution Explorer".

  6. In Solution Explorer, right-click the main project file in your C++ Application, and click the "Properties" Option. Your should the properties dialogue of your C++ Application appear afterwards.
    [​IMG] [​IMG]
  7. In the properties Dialogue, expand "Configuration Properties" and click the "VC++ Properties" option.
    [​IMG]
  8. In the "VC++ Directories" menu, click and expand the Include Directories filed as shown in the below screen shot.
    [​IMG]
  9. Within the Include Directories dialogue, link the directories of the include folder placed in the main directory of your project, and the curl folder inside it, to your C++ application. Afterwards click "OK" to apply link settings and close the dialogue.
    [​IMG][​IMG][​IMG]
  10. In the properties Dialogue, within the Configuration Properties, expand the "Linker" option and click the Input option within the sub-category.
    [​IMG]
  11. Minimize your project, open your libCURL library folder again, and copy the LIB and DLL Files within the main directory of the folder, to the debug folder in your C++ application.
    [​IMG][​IMG]
    Note: If the debug folder doesn't exist inside your VS C++ Project folder, go back to your C++ Application, close the properties dialogue, and just debug the empty project. The debug folder should be generated straight afterwards. Finally, just follow steps 5, 6, and 10, to get back to this step of the implementation of the cURL library. 

  12. You will need the cURL LIBSASL DLL file in addition to the cURL DLL files which you have pasted in the debug folder, as the LIBSASL library is what the main bits of curl operate off. So download the LIBSASL DLL file and place it in the debug folder.
    [​IMG]
  13. In the Input menu, click and expand the "Additional Dependencies".
    [​IMG]
  14. In the debug folder, within the cURL LIB and DLL files which you've copied, add the link of the libcurl_imp library file (located in the debug folder) inside the additional dependencies.
    [​IMG]
  15. Click OK, and click OK again to close the properties dialogue.

  16. In your C++ Application coding interface, include the "curl.h" header file from the C++ cURL library you just linked.
    [​IMG]
  17. Use cURL features in your C++ Application! 
I hope you enjoyed my tutorial, hopefully I can get some good feedback. Adios!

0 comments