C ++错误:无法解析函数“ get_time”-Ubuntu g ++

门德斯

我的课程上有以下C ++代码段,用于将ISO 8601字符串转换为time_t结构:

#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

根据此处std::get_time应包含在iomanip

我以为我要做的就是包括iomanip...我在这里错过了什么吗?

我正在运行Ubuntu 14.04 LTS。

感谢您的帮助。

托尼·德罗伊(Tony Delroy)

此错误报告的底部,Jonathan Wakely报告了GCC 5中提供的错误。您可以使用它g++ --version来检查您的版本。(应该是std::tm tenpTimeFWIW)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章