如何在Eclipse Luna中启用c ++ 11? [英] How to enable c++11 in eclipse Luna?

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

问题描述

  • 我有Eclipse Luna.我想在我的项目中使用自动变量,为此我需要在Eclipse中启用 c ++ 11 .我已经遵循以下答案Eclipse CDT C ++ 11/C ++ 0x支持
  • 但是在我项目的属性中,没有像 c/c ++ Build这样的选项.只有一个名为 c/c ++ General 的选项.
  • 因此,使用 c/c ++ general 如何在eclipse中启用c ++ 11.请任何人都知道解决方案,然后提及steps.thanks.
  • I have eclipse Luna.I want to use auto variable in my project and for that i need to enable c++11 in eclipse.I have followed this answer Eclipse CDT C++11/C++0x support
  • But in my project's property, there are no option like c/c++ Build. There are only one option named c/c++ General.
  • So using c/c++ general how can i enable c++11 in my eclipse.Please anybody know the solution then mention steps.thanks.

推荐答案

对于Eclipse Luna,请转到项目">属性">"C/C ++ Build">设置">工具设置">"Cross G ++编译器"(或您使用的任何编译器设置)并选择"ISO C ++ 1y(-std = c ++ 1y)"或"ISO C ++ 11(-std = c ++ 0x)".或者,在其他方言标志"中,您可以输入std = c ++ 11或std = c ++ 14,但是如果以这种方式进行操作,则可能必须采取此处未涵盖的其他步骤,因此Eclipse编辑器将在编辑器中为正确的C ++版本生成错误标记.

For Eclipse Luna, go to Project > Properties > C/C++ Build > Settings > Tools Settings > Cross G++ Compiler (or whichever compiler setting you're using) and choose "ISO C++1y (-std=c++1y)" or "ISO C++11 (-std=c++0x)". Or instead, in "Other dialect flags", you can put std=c++11, or std=c++14, but if you do it this way you'll probably have to take an additional step not covered here so the Eclipse editor will produce error flagging for the correct C++ version in the editor.

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

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