'Curl using Nuget on Visual Studio 2022 doesn't work
I've been trying to get Curl to work with VS for weeks. I've read a ton of other tutorials, guides, installation instructions and other materials and just... Nothing is working. So far, I've managed to install Curl through Nuget on both VS 2019 and 2022. I tried to download older versions to try there to, but... No dice.
So far, I know I need to add 'libcurl.lib' inside the Linker settings after installing curl. However, after doing so... It says it cannot find libcurl.lib, and I'm just perplexed. I also read in some places that you need to add some include options inside the VC++ Directories options, but that didn't work either, I just get unresolved symbols issues.
I even tried to build the project directly from downloading it on the curl website, getting the lib file from there, and putting it in the include folder of my Visual Studio, but that didn't work either.
I got this code from a different question here, and I'm trying to run it just as a sanity check:
#include <iostream>
#include <curl/curl.h>
int main(void)
{
CURL* curl;
CURLcode res;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
If anyone knows what settings I'm missing, what options I need to tick on, if there's any other sort of hidden checkbox or something I forgot or didn't know about... Please let me know. Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
