首页 > 编程语言 > 详细

使Eclipse CDT 4.4 Luna 支持 c++ 11 的设置

时间:2014-09-06 01:06:52      阅读:821      评论:0      收藏:0      [点我收藏+]

用Eclipse Luna编译C++ 11源码总是出错,编译器用的mingw gcc,需要在CDT设置如下:

菜单:

Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build-in Compiler Settings

添加-std=c++11

右键项目属性:

Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Dialect

添加 -std=c++11 到other dialect flags 或者列表里面选择 ISO C++11 

如果是CMake项目:

cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ..

右键项目属性:

Properties -> C/C++ General -> Preprocessor Include Paths, Marcos etc. -> Providers

使 CDT GCC Build-in Compiler Settings 优先 Contributed PathEntry Containers 

菜单里面选择 Project ->C/C++ Index 重建索引使c++ 11的代码提示正确。


来自

http://stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support

使Eclipse CDT 4.4 Luna 支持 c++ 11 的设置

原文:http://blog.csdn.net/ustcwudi/article/details/39090591

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!