std::chrono
应该在 g++ 4.8.*
中得到支持。但是,当我尝试使用 g++ 4.8.3
进行编译时,它找不到各种声明。当然,我正在使用 -std=c++11
.
例如此调用(来自自动生成的文件;这就是 -std
出现两次的原因):
g++-4.8 -g -msse2 -m64 <defines> <warnings> -std=c++11 -fexceptions -std=c++11 <includes'-path> -c <source-file.cpp> -o <out-path>
产生此错误:
<source-file, line>: error: ‘std::chrono::monotonic_clock’ has not been declared
我找不到very much这不是立即的编译器版本或丢失 -std=c++11
。由 this 推断,我不需要任何其他东西。
问题:出了什么问题,如何修复?
最佳答案
标准 C++ 中没有 std::chrono::monotonic_clock
。有一个std::chrono::steady_clock
然而。
公平地说,微软 - 和各地的墨西哥卷饼 - there was a monotonic_clock
in the working drafts during the development of C++11 which was replaced by steady_clock
.
关于c++11 - g++ 4.8.* std::chrono 未声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27111756/