如何将模式从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)?

查看:561
本文介绍了如何将模式从C ++ 98模式在Dev-C ++中改为支持C ++ 0x(基于范围)的模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是学习如何编写基于循环的范围,但唯一的问题是,我的编译器,Orwell Dev-C ++似乎不支持它的默认模式(这是c ++ 98)。如何将此模式更改为另一个支持此功能(和C ++ 0x的其他功能)。谢谢。另外:



这是错误信息:[错误]基于范围的循环不允许在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屋!

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