How to enable C++11 support in DEV-C++

DEV-C++ enables C++11 by default; manual configuration for C++11 support is required.

A relatively newer version of DEV-C++ is recommended.
Download link for DEV-C++ 5.11:

Dev-C++ download | SourceForge.net

Let's open Dev-C++, and create a new C++ code file.

#include <iostream>
using namespace std; 
int main() {
    auto x = 42; // C++11 
    cout << x <<endl;
    return 0;
}

This code will cause errors in compilers that do not support C++11.

2025112808_763h.png

To enable C++11 support, click on 'Compiler Options' in the 'Tools' menu.

2025112809_5hj4h.png

First, check the box for "Add the following commands when compiling".

Then, enter the following in the box below:

-std=c++11

2025112806_8ui6h3.png

Then, click OK and recompile/run the program. You will see that C++11 is now supported.

2025112810_74uh.png

Subscribe to CodeEachDay

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe