gpt4 book ai didi

c++ - ISO C++ 禁止声明 .. 没有设置 --std=c++0x 的类型

转载 作者:太空狗 更新时间:2023-10-29 20:39:06 25 4
gpt4 key购买 nike

在我的 c++ 代码中,我使用 auto 类型,为了启用 c++11,我将标志 --std=c++0x 添加到我的makefile,但如果我使用 -std=gnu++11-std=c++11,我得到了cc1plus: error: unrecognized command line option "...",我的gcc版本是4.3.4 请问这个应该怎么解决?谢谢。

在没有启用 c++11 的情况下,我得到了 ISO C++ forbids declaration of wallclock with no type 错误,如下一行:

auto wallclock  = time(nullptr);

最佳答案

在 4.4 版之前的 GCC 中未实现对 auto 类型变量的支持。您使用的版本太旧。

参见支持矩阵:https://gcc.gnu.org/projects/cxx0x.html

关于c++ - ISO C++ 禁止声明 .. 没有设置 --std=c++0x 的类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29028438/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com