How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?

一曲冷凌霜 提交于 2019-11-26 20:21:27

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.

  1. Download from the following link http://orwelldevcpp.blogspot.in/2015/04/dev-c-511-released.html

  2. Go to Tools->Compiler Option->Programs

and add -std=c++11

see the image

In Dev C++ 5.2.0.3 it's as simple as go to Tools->Compiler Options->Settings->Code Generation and setting Language standard (-std) to ISO C++11

Was facing the same issue in Code::Blocks. to fix the problem, in Build Options->Compiler Flags, tick the box "Have g++ follow the c++11 ISO C++ language standard [-std=c++11]"

Gauhar Singh

In Dev-C++ 5.11 an error comes in new tab like this:

This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

For this you have to follow four simple steps:

  1. Go to Tools Tab
  2. Select Compiler Options..
  3. Go to General tab
  4. Check the checkbox named "Add following commands when calling the compiler", write this statement -std=c++11, and then press OK

Conclusion: Error is removed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!