使用eclipse编译含有C++11特性的代码

up vote 95 down vote accepted

I found this article in the Eclipse forum, just followed those steps and it works for me. I am using Eclipse Indigo 20110615-0604 on Windows with a Cygwin setup.

Make a new C++ project Default options for everythingOnce created, right-click the project and go to "Properties"C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous -> Other Flags. Put -std=c++0x at the end . ... instead of GCC C++ Compiler I have also Cygwin compilerC/C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste __GXX_EXPERIMENTAL_CXX0X__ (ensure to append and prepend two underscores) into "Name" and leave "Value" blank.Hit Apply, do whatever it asks you to do, then hit OK.

There is a description of this in the Eclipse FAQ now as well: Eclipse FAQ/C++11 Features.





使用eclipse编译含有C++11特性的代码,总是出错。最后在stackoverflow找到了解决方法。
1. 右击项目,选择Properties。
2. C/C++ Build --> Settings --> Tool Settings --> GCC C++ Compiler --> Miscellanous。在右边的Other Flags中把 "-std=c++0x" 引号中的内容放到已有内容的后面。
-std=c++0x

2.C/C++ General -> Paths and Symbols -> Symbols -> GNU C++。点击Add,name栏复制__GXX_EXPERIMENTAL_CXX0X__,value为空。
__GXX_EXPERIMENTAL_CXX0X__

3. OK。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值