curl: funktioniert mit windows aber nicht mit linux?
-
Hi!
Habe folgenden Quelltext:
CURL *socket = curl_easy_init(); std::string buffer; curl_easy_setopt(socket, CURLOPT_URL, wxT("http://www.google.de")); curl_easy_setopt(socket, CURLOPT_WRITEFUNCTION, writer); curl_easy_setopt(socket, CURLOPT_WRITEDATA, &buffer); curl_easy_perform(socket); curl_easy_cleanup(socket); wxString ende(buffer.c_str(), wxConvUTF8); wxMessageBox(ende);
static int writer(char *data, size_t size, size_t nmemb,std::string *buffer) { // What we will return int result = 0; // Is there anything in the buffer? if (buffer != NULL) { // Append the data to the buffer buffer->append(data, size * nmemb); // How much did we write? result = size * nmemb; } return result; }
In Windows funktioniert alles wunderbar, aber in linux ist die Messagebox hinterher einfach leer.
Ich benutze zusätzlich noch wxWidgets, sollte aber nichts ausmachen.Gruß,
Speidel