ho installato ricciolo questo comando (io uso Ubuntu):curl.h. Nessun file o directory
sudo apt-get install curl
quando i test semplice programma utilizzando g++ test.cpp
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* 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);
}
return 0;
}
g++
mi mostra:
fatal error: curl/curl.h: No such file or directory
compilation terminated.
Qualcuno può aiutarmi?
Ubuntu ha un pacchetto' curl-devel'? Il 'libcurl-dev' virtuale è fornito da molti altri, ad es. 'libcurl4-openssl-dev', che ha funzionato per me. – DSM
Scusa, ho confuso le mie distro ... dovrebbe essere libcurl-dev, modificato la risposta –
Grazie io uso 'sudo apt-get install libcurl4-openssl-dev' e' g ++ test.cpp -L/usr/include/curl/lib -lcurl' – user1518451