我有我的類下面的一段C++代碼,在ISO 8601字符串轉換爲time_t
結構:C++錯誤:函數「GET_TIME」無法解析 - Ubuntu的G ++
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
#include <ctime>
.... class code...
struct tm tempTime;
std::stringstream ss(data);
ss >> std::get_time(&tempTime, "%FT%TZ");
std::time_t time = mktime(&tempTime);
.... class code...
但是,編譯硬要給我下面的錯誤:
Function 'get_time' could not be resolved
據here,std::get_time
應包含iomanip
我想我所要做的只是包括iomanip
......我在這裏錯過了什麼嗎?
我正在運行Ubuntu 14.04 LTS。
感謝您的幫助。
您鏈接的頁面表示這是一個C++ 11功能。你確定你正在使用正確的編譯器嗎? – Diego
是...... C++ 11已打開:'g ++ -std = C++ 0x' – Mendes