This is a repo containing a precompiled version of the C++ cURL library, libcURL. This was built for both x86 and x64 projects in Visual Studio 2019 (VS version 16).
- Download the *.zip file, and extract the
curlfolder inside wherever you want the curl dependencies to be in your project. - Open your project configuration in Visual Studio.
- Add the
includedirectory for your respective build in the C++ additional include directories section. - Add the
libsdirectory for your respective build in the linker's additional directories section. - Also add the following to the linker,
Normaliz.lib;Ws2_32.lib;Wldap32.lib;Crypt32.lib;advapi32.lib;in every config. - Then add either the
libcurl_a.liborlibcurl_a_debug.libdependency to the linker depending on your build. - Add
#define CURL_STATICLIBright before the curl include, then add the curl include (#include <curl/curl.h>). - You should be all set to use curl now!
Add the following boilerplate curl code to part of your program to test if everything is working.
CURL* curl = curl_easy_init();
if(curl)
{
// Success
curl_easy_cleanup(curl);
}
else
{
// Failed.
};
If you compile this successfully, it should be all set. Additionally, feel free to test out by adding print-out statements where the // Success and // Failed. comments are in the above code.