eclipse支持c++11
2014-12-23 22:00
711 查看
http://wiki.eclipse.org/CDT/User/FAQ#CDT_does_not_recognize_C.2B.2B11_features
CDT does not recognize C++11 features
GCC needs the compiler option "-std=c++0x" or "-std=gnu++0x" depending on your needs.(please note: check the GCC manual also, because different GCC version may support different switches. For example GCC 4.7 accepts -std=c++11 also.)
Standard Project with managed make:
Open Project Properties->C/C++ Build->Settings->Tool Settings->GCC C++ Compiler->Miscellaneous->Other Flags. Put "-std=c++0x" at the end.
Since CDT 8.3 there is a new "Dialect" option in the compiler option settings, see: https://wiki.eclipse.org/CDT/User/NewIn83#Toolchains
Makefile project:
You must add the compiler option "-std=c++0x" to your Makefile.
To make the code completion and code analysis work:
You should add the option -std=c++0x to the scanner discovery in Project Properties->C/C++ Build ->discovery Options in the field "compiler invocation arguments" (note the warning at the bottom of the page).
You then need to make the indexer update:
Open Project Properties->C/C++ General->Index->Index source and header files opened in the editor. If you are not using project specific settings you need to follow the link to "Configure workspace settings". This needs to be checked. Give it a minute to
reindex.
Since Eclipse Juno a new Scanner Discovery is integrated in CDT version 8.1. This new scanner has a "hidden" option to set the C++11 feature, see this message:
http://www.eclipse.org/forums/index.php/mv/msg/373462/909018/#msg_909018
> Project Properties->C/C++ General->Preprocessor Include Paths,
> Macros->[Providers] tab->your Built-in Compiler Settings provider
> (toolchain dependent).
> Click on "Workspace Settings" link which gets you to "Settings" property
> page, select [Discovery] tab and your provider again. There is "Command
> to get compiler specs", add "-std=c++0x" in there.
相关文章推荐
- Eclipse CDT c++支持C++11
- 关于在ubuntu下eclipse中c++11支持和编译运行c++11报错的解决方法
- Eclipse - "Eclipse CDT" (Eclipse C++) 安装 与 配置 (支持C++11)
- Eclipse - "Eclipse CDT" (Eclipse C++) 安装 与 配置 (支持C++11)
- 让eclipse支持C++11特性
- Eclipse CDT C++11/C++0x support 支持c++11特性例如shared_ptr
- eclipse c++11支持
- jni 简单实践 eclipse支持c++11
- ubuntu12.04 eclipse c++对c++11的支持
- eclipse支持C++11
- Eclipse CDT对C++11的支持
- 关于在ubuntu下eclipse中c++11支持和编译运行c++11报错的解决方法
- 让eclipse CDT支持C++11
- eclipse中添加c++11支持
- eclipse Neon 设置支持C++11
- Eclipse开发linux c/cpp---支持c++11特性
- Ubuntu Eclipse CDT C++11的支持
- 解决std::addressof找不到及eclipse lunna+cdt 8.6.0 支持 c++11的设置
- Ubuntu下如何设置Eclipse支持GBK和GB2312编码
- Eclipse支持JQuery代码自动完成