0

When I try to use unordered_map in my dev c++ compiler its showing this:

#error 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.
Gulshan Aggarwal
  • 954
  • 1
  • 7
  • 13
  • 4
    The Dev-C++ IDE is old and unmaintained, and lacks many features commonly found in more modern IDE's. But more importantly, the compiler it ships with is also old, so old that it doesn't support most of "modern" C++ as it was introduced with the C++11 standard ten years ago. There are some free IDE's available, that comes with more up to date compilers. – Some programmer dude Aug 26 '21 at 06:26
  • You are absolutely right @Someprogrammerdude but college students still use this to learn programming, that's the reason to post this question. – Gulshan Aggarwal Aug 26 '21 at 06:28
  • @prehistoricpenguin this question doesn't solves your problem. – Gulshan Aggarwal Aug 26 '21 at 12:19

1 Answers1

1

If you are getting this error while using DevC++ then below is a simple following trick you should follow-

Step 1. Go to Tools (click).

Step 2. then Click on the Compiler Options

Step 3. then Click on the Settings option

Step 4. then Click on the Code Generation

Step 5. Now, You will find Language standard option and click on the right side to down arrow icon and select GNU C++ 11 and hit ok.

Now finally try again to compile your code it will work fine.

Gulshan Aggarwal
  • 954
  • 1
  • 7
  • 13