我的代码是使用 g++ 编译器版本 4.9.0 编译的。我正在使用 C++11。
但是,编译器不理解 nullptr
关键词。这是我发现的:
nullptr
这个词在编辑器中以粗体显示。 nullptr
,因为它的版本大于 4.6.0。 auto
时它不会报错或 decltype
前一行(我使用 -std=c++0x
命令行参数,但我也使用 -std=gnu++0x
)。 我不知道还有什么问题,所以我会很感激任何建议。
编辑:错误消息如下:
error: nullptr was not declared in this scope.
这是的输出
g--版本命令:
g++ (OSE 4.9.2-2 20160202) 4.9.2
最佳答案
最新版本的 g++ 中的标志是 -std=c++11
.
关于c++11 - g++ 编译器不理解 nullptr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36476700/