I am trying to use libcurl with the program I am creating, but I have problems with it. So far, I have only tried examples from the libcurl website, but they crash as soon as the program gets into curl initialization.
My current code is:
#include <iostream>
#include <curl/curl.h>
int main(int argc, char *argv[])
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl)
{
curl_easy_setopt(curl, CURLOPT_URL, "http://garrysmod.fi/");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
I also made sure that the compiler and linker can find the resources and that the DLL file (libcurl.dll) is in the program folder, but it continues to fail. I tried debugging with VS2010, and it gave me an "access violation" error when initializing the curl_easy_init () function.
Any help would be appreciated!
source
share