简体   繁体   English

如何在Eclipse Luna中启用c ++ 11?

[英]How to enable c++11 in eclipse Luna?

  • 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 我有Eclipse Luna。我想在我的项目中使用auto变量,为此我需要在eclipse中启用c ++ 11。我遵循了这个答案Eclipse CDT C ++ 11 / C ++ 0x支持
  • But in my project's property, there are no option like c/c++ Build. 但是在我项目的属性中,没有像c / c ++ Build这样的选项 There are only one option named c/c++ General . 只有一个名为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. 因此,使用c / c ++ general我如何在eclipse中启用c ++ 11。请任何人都知道解决方案,然后提及steps.thanks。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM