如何将模式从 Dev-C++ 中的 c++98 模式更改为支持 C++0x 的模式(基于范围)? [英] How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?

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

问题描述

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

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:

这是错误消息:[错误] C++98 模式中不允许基于范围的 for 循环

This was the error message: [Error] range-based-for loops are not allowed in C++98 mode

我运行的是 Windows 8

I run Windows 8

我的 Dev C++ 版本是 5.3.0.3

The version I have of Dev C++ is 5.3.0.3

并且编译器是 TDM-GCC 4.6.1 64 位.

And the compiler is TDM-GCC 4.6.1 64 bit.

谢谢大家

推荐答案

转到工具->编译器选项->编译器"选项卡

选中标记为调用编译器时添加以下命令"的复选框并在文本输入框中添加-std=c++11"或者如果这不起作用-std=C++0x"

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"

反正应该是这样的,我已经很多年没有安装Dev C++了,所以我不得不在谷歌上看一些截图来记住.

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.

这篇关于如何将模式从 Dev-C++ 中的 c++98 模式更改为支持 C++0x 的模式(基于范围)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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