使用 Eclipse 构建 c++0x 功能 [英] Build c++0x features with Eclipse
问题描述
使用 Eclipse 构建时收到有关 c++0x 关键字的警告和错误.示例:
When build with Eclipse get warnings and errors about c++0x keywords. Example:
标识符 ‘decltype’ 将成为 C++0x 中的关键字
identifier ‘decltype’ will become a keyword in C++0x
如何解决?
Project->Properties->C/C++ Build->Discovery options->GCC C++编译器->编译器调用参数->[-E -P -v -dD${plugin_state_location}/specs.c --std=gnu++0x]
Project->Properties->C/C++ Build->Discovery options->GCC C++ Compiler->Compiler Invocation Arguments->[-E -P -v -dD ${plugin_state_location}/specs.c --std=gnu++0x]
但它没有效果,有趣,即使将空字符串放在那里,它也会尝试以相同的错误进行编译.不知道这个参数需要什么(
but it hasnt effect, intresting, even if put there empty string it will try to compile with the same errors. Dont know for what this parameter needed(
推荐答案
试试这个:
Project -> Properties -> C++-Build[Settings] -> G++Compiler[miscellanous] -> Other flags
Project -> Properties -> C++-Build[Settings] -> G++Compiler[miscellanous] -> Other flags
在那里添加-std=c++0x".
Add "-std=c++0x" there.
这篇关于使用 Eclipse 构建 c++0x 功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!