I just created an empty C++ project in VS2019. Installed Curl through NuGet together with openssl, ssh2 and zlib etc.
Now, what I would expect that it resolves the packages while building the solution, what else is a package manager for? Meh, I get the following errors:
Error LNK2019 unresolved external symbol _curl_slist_append referenced in function "public: bool __thiscall checkApi(void)"
A well know error but I could find no solution for this issue. I tried adding it to additional libraries, I tried adding directories, folders, linkages nothing works. I have read the PDFS for VS2013 and 2015 they DONT work.
I hope anyone can point me in the right direction. It should not be this hard with a package manager or am I wrong?
I have (obviously)
#include "curl/curl.h"
#include "curl/easy.h"
And then a method doing:
this->chandle = curl_easy_init();
if (this->chandle) {
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(this->chandle, CURLOPT_VERBOSE, 1);
curl_easy_setopt(this->chandle, CURLOPT_HTTPGET, 1);
curl_easy_setopt(this->chandle, CURLOPT_URL, api_url);
curl_easy_setopt(this->chandle, CURLOPT_HTTPHEADER, headers);
CURLcode ccode = curl_easy_perform(this->chandle);
curl_easy_cleanup(this->chandle);
}