So I downloaded the zip file from the curl website. I copied the directory with all of the header files into my include directory. Including the curl.h works with no problems, however, when I go to actually call a function, suddenly my c++ app will no longer compile.
Here's the error I'm receiving:
[Linker error] undefined reference to
`curl_easy_init'
Here's the code:
#define CURL_STATICLIB
#include <curl/curl.h>
#include <string>
#include <iostream>
using namespace std;
int main() {
string url = "http://www.google.com";
cout << "Retrieving " << url << endl;
// Our curl objects
CURL *curl;
CURLcode result;
// Create our curl handle
curl = curl_easy_init();
system("pause");
return 0;
}
It works fine if I comment out the curl=curl_easy_init() line.
According to the documentation this should work, as seen here.
Any ideas?