Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 663
Victor Odouard Avatar asked Jun 05 '13 23:06

Victor Odouard


People also ask

How do I change from C ++ 98 to C ++ 11?

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

How do I enable C++ 11 in Dev CPP?

Support for C++11 Here, select the "Settings" tab, and within it, the "Code Generation" tab. There, in "Language standard (-std)" select "ISO C++ 11": Ok that. You are now ready to compile C++11!


1 Answers

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.

like image 125
Jamin Grey Avatar answered Oct 08 '22 19:10

Jamin Grey