Unrecognized command line option "-std = C ++ 11" for GCC 4.8.1

After reading a lot of literature on the Internet, it seems that the latest versions of GCC definitely support the command-line option -std=c++11. But for some crazy reason, I get an “unrecognized command line option” even when using GCC 4.8.1, which makes no sense.

C:\newmingw\mingw32\bin>g++ -v
Using built-in specs.
COLLECT_GCC=g++
Target: i686-w64-mingw32
Configured with: [trimmed]
Thread model: win32
gcc version 4.8.1 (rev5, Built by MinGW-W64 project)

C:\newmingw\mingw32\bin>g++ -std=c++11 test.cpp
cc1plus: error: unrecognized command line option "-std=c++11"

Is there anything else that needs to be done here? TIA!

+4
source share
1 answer

I am using mingw obtained through mingw-get from http://www.mingw.org/wiki/Getting_Started
I cannot confirm your problem. Perhaps this is due to the fact that your version of x64?

:

C:\>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: [...]
Thread model: win32
gcc version 4.8.1 (GCC)

, ++ 11.

+1

Source: https://habr.com/ru/post/1529600/


All Articles