如何在Eclipse Neon中启用C ++ 11语法? [英] How do you enable C++11 syntax in Eclipse Neon?

查看:79
本文介绍了如何在Eclipse Neon中启用C ++ 11语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Eclipse Neon中开发C + 11代码,今天注意到,C + 11中引入的基于循环的范围由IDE突出显示为红色,表明它无法识别。



我找到了多个有关如何对CDT的较旧版本执行此操作的链接,例如(



有人可以建议如何配置我的项目,以便正确突出显示C ++ 11语法(我正在使用单独的构建系统)

解决方案


  1. 右键单击您的项目,然后单击属性

  2. 导航至C / C ++常规和预处理器的包含路径,宏等。

  3. 选择提供程序选项卡,请单击要使用的编译器的编译器设置行。

  4. 在Command中添加-std = c ++ 11以获得编译器规格。

  5. 应用

看起来像这样:

  $ {COMMAND} -E -P -v -dD $ {INPUTS} -std = c ++ 11 


I am developing C+11 code in Eclipse Neon and noticed today that the range based for loop introduced in C+11 is highlighted red by the IDE indicating it does not recognize it.

I have found multiple links about how to do this for older versions of CDT such as this (Eclipse CDT C++11/C++0x support) You can see though there is no "Tool Settings" tab.

Can someone suggest how to configure my project so that C++11 syntax is correctly highlighted (I am using a separate build system)

解决方案

  1. Right click on your project and click Properties
  2. Navigate to C/C++ General and Preprocessor Include Paths, Macros etc.
  3. Select the Providers tab, click on compiler settings row for the compiler you use.
  4. Add -std=c++11 to Command to get compiler specs.
  5. Apply changes.

Will look something like this:

${COMMAND} -E -P -v -dD "${INPUTS}" -std=c++11

这篇关于如何在Eclipse Neon中启用C ++ 11语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆