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

use*_*367 3 c++ c++11

在我的c ++代码中,我正在使用auto类型,为了启用c ++ 11,我将标志添加--std=c++0x到我的makefile中,但是我仍然得到错误ISO C++ forbids declaration of .. with no type,如果我用-std=gnu++11或启用c ++ 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);
Run Code Online (Sandbox Code Playgroud)

Mag*_*off 5

auto在4.4版之前的GCC中没有实现对-typed变量的支持.您使用的版本太旧了.

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