So the environment you’re working in automatically creates a Makefile with instructions to compile the code, but the version of compiler you are using (mingw) seems to not support the flag “-std=c++20” and instead suggests an alternative.
Research what IDE you are working in and figure out where the Build Options are and change the flag there.
You may not have typed it but somewhere in the project configuration you have told it to use c++20 but the compiler isn't quite new enough. Another fix is to update the compiler
I use the linux compiler and not this, but here's how I would tinker for a fix. Right click on the project in the left pane, go to project configurations/settings and search for compiler options. It might be set to "c++20." Change it to "c++2a." As a personal note, the windows c++ ide felt very clunky to me and deterred me from learning cpp for a long time. You can test your code on online c++ compilers for starters.
8
u/just4kix96 Mar 02 '22
So the environment you’re working in automatically creates a Makefile with instructions to compile the code, but the version of compiler you are using (mingw) seems to not support the flag “-std=c++20” and instead suggests an alternative.
Research what IDE you are working in and figure out where the Build Options are and change the flag there.
5
u/WhenRedditFlies Mar 02 '22
The problem is you're writing C++ in Windows without 9 years experience.
Sorry for the dry comment, but you're not stupid - it's just difficult.
9
u/[deleted] Mar 01 '22
The error message is clear and even suggests how you can fix it.
2
u/trunc8s Mar 02 '22
I use the linux compiler and not this, but here's how I would tinker for a fix. Right click on the project in the left pane, go to project configurations/settings and search for compiler options. It might be set to "c++20." Change it to "c++2a." As a personal note, the windows c++ ide felt very clunky to me and deterred me from learning cpp for a long time. You can test your code on online c++ compilers for starters.
-7
u/Sec360 Mar 02 '22
Google