eclipse支持c++11

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.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值