且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-05-18 23:20:17

对于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.