How to Compile C++11 Code with Orwell Dev-C++

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

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.

Orwell Dev C++ doesn't work with C++11

It is a known bug that to_string does not work with MinGW yet (which is actually GCC's fault, to a degree):

  • http://sourceforge.net/p/mingw/bugs/1578/
  • http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015

Intellisense is often driven by a different engine than the compiler (as very few compilers have hooks to make intellisense easy), so that's likely why you're seeing it in your IDE when it's not supported by your compiler.

how to enable C++11 or C++14 in Dev C++ IDE

Follow these Steps in DevC++.

Got to Tools -> Compiler Options... -> Settings -> Code Generation

Sample Image

In language standard(std), choose -> ISO C++11

more https://www.geeksforgeeks.org/how-to-fix-auto-keyword-error-in-dev-cpp/

I am using the dev c++ and i am getting the error ( C++98 'array' must be initialized by constructor)

You are trying to use the so called initializer_list (take a look here if you do not know what they are) which is a way of costructing objects introduced by c++11.

Hence you need to tell your compiler that you want to use c++11 by passing the argument -std=c++11 to the compiler itself.

Take a look at this question to see how to do it.



Related Topics



Leave a reply



Submit