eclipse支持C++11

来源:互联网 发布:淘宝淘金币哪里可以买 编辑:程序博客网 时间:2024/05/17 20:26

编译器采用的是MInGW

步骤

  1.  右键项目 -> properties -> C/C++ Build -> Settings -> GCC C++ Compiler -> Miscellaneous添加 ”std=c++0x" ,不要引号 ,然后各种apply 和OK

  2. 右键项目 -> properties -> C/C++ General -> Preprocessor Include Paths,Macros, etc. -> Providers 

    勾选CDT GCC Built in Compiler Settings MinGW ,因为我用的是MinGW

    取消 下面的Use gloabal provider shared between projects

    同样在下面的Command to get Compiler spes 的值的后面加上“std=c++0x” 不要引号

    然后apply and OK


  3. 返回项目workspace ,选择Project菜单 -> C/C++ index -> Re-resolve unresolved includes

  4. 如果出了一堆错误 就将上文的-std=c++11 替换为 -std=gnu++11

参考网址:http://tangmingjie2009.iteye.com/blog/2089083
http://stackoverflow.com/questions/38436542/mingw-cxxtest-bizarre-errors

1 0
原创粉丝点击