的對象,這是我的代碼:C++不能通過非POD類型
#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實際上不是一個問題。呃,我猜... – ildjarn