【发布时间】:2012-05-13 12:48:54
【问题描述】:
这是我的代码:
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <stdio.h>
#include <curl/curl.h>
using namespace std;
int main ()
{
ifstream llfile;
llfile.open("C:/log.txt");
if(!llfile.is_open()){
exit(EXIT_FAILURE);
}
string word;
llfile >> word;
llfile.close();
string url = "http://example/auth.php?ll=" + word;
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
这是我编译时的错误:
main.cpp|29|警告:不能通过
'...'传递非POD类型'struct std::string'的对象;调用将在运行时中止
【问题讨论】:
-
+1 表示 SSCCE,-1 表示实际上没有提出问题。呃,+0 我猜...
标签: c++ curl libcurl codeblocks