On 25/09/2014 at 09:27, xxxxxxxx wrote:
Well, I reached as far as:
#include <stdio.h>
#include <curl/curl.h>
CURL *curl;
CURLcode res;
char* usrpass="my_username:my_password";
char* pointer="1234567890";
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://my_url_pointing_to_the_file");
curl_easy_setopt(curl, CURLOPT_USERPWD , usrpass);
curl_easy_setopt(curl, CURLOPT_READDATA, pointer);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
But, when building, I get:
Undefined symbols for architecture x86_64:
"_curl_easy_init", referenced from:
PluginStart() in main.o
"_curl_easy_setopt", referenced from:
PluginStart() in main.o
"_curl_easy_perform", referenced from:
PluginStart() in main.o
"_curl_easy_strerror", referenced from:
PluginStart() in main.o
"_curl_easy_cleanup", referenced from:
PluginStart() in main.o
ld: symbol(s) not found for architecture x86_64
Also, I get "Conversion from string literal to 'char *' is deprecated"
Can someone help me out with this?