如何将模式从C ++ 98模式在Dev-C ++中改为支持C ++ 0x(基于范围)的模式? [英] How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?
问题描述
这是错误信息:[错误]基于范围的循环不允许在C ++ 98模式
我运行Windows 8
我有Dev C ++的版本是5.3.0.3
编译器是TDM-GCC 4.6.1 64位。
感谢大家
转到工具 - >编译器选项 - >编译器标签。
选中标有 >在调用编译器时添加以下命令
并在文本输入框中添加 -std = c ++ 11 或如果不起作用 -std = C ++ 0x
应该是这样的,我还没有安装Dev C ++多年,我不得不看看在谷歌的一些截图要记住。
I am just learning how to write range based for loops, but the only problem is that my compiler, Orwell Dev-C++ doesn't seem to support it in its default mode (which is c++98). How can I change this mode to another one that supports this feature (and other features of C++0x). Thanks. Also:
This was the error message: [Error] range-based-for loops are not allowed in C++98 mode
I run Windows 8
The version I have of Dev C++ is 5.3.0.3
And the compiler is TDM-GCC 4.6.1 64 bit.
Thanks to everyone
Go to Tools -> Compiler Options -> "Compiler" tab
Check the checkbox labeled, "Add the following commands when calling the compiler" And add in the text entry box, "-std=c++11" or if that doesn't work "-std=C++0x"
Should be something like that anyway, I haven't had Dev C++ installed for many years, so I had to look at some screenshots on Google to remember.
这篇关于如何将模式从C ++ 98模式在Dev-C ++中改为支持C ++ 0x(基于范围)的模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!