这是我第一次使用libcurl。 当它出现在
中时,它会与附加的错误一起崩溃curl_easy_perform(curl);
这是我的代码:
#include <iostream>
#include <sstream>
#include <string>
#include <curl/curl.h>
using namespace std;
int main(){
curl_global_init(CURL_GLOBAL_ALL);
CURL *curl;
CURLcode res = CURLE_OK;
string content;
string URL = "http://example.com";
curl = curl_easy_init();
if (curl){
curl_easy_setopt(curl, CURLOPT_URL, URL);
int res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
/*ostringstream out;
out << res;
curl_easy_cleanup(curl);
content = out.str();*/
}
curl_global_cleanup();
return 0;
}
程序:d:\ Visual \ WebServerCURL \ Debug \ WebServerCURL.exe文件: f:\ dd \ vctools \ crt \ crtw32 \ misc \ dbgheap.c行:1322
表达式:_CrtIsValidHeapPointer(pUserData)
先谢谢!