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

来源:互联网 发布:ubuntu安装远程桌面 编辑:程序博客网 时间:2024/06/14 19:39
使用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。
原帖地址:http://stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support

原创粉丝点击