I\'m on Windows 10 with MinGW, and recently updated my g++
, using mingw-get update
and mingw-get upgrade
. This error occurred, even af
I still have not found a solution. The above did not work for me. For now, I'm using visual studios compile via command line cl /EHsc somefile.cpp
. Here is a reference, https://msdn.microsoft.com/en-us/library/ms235639.aspx.
In Clion
Thanks to @SilencePhil, I found a relevant StackOverflow answer. This question is not the same question, but has the same solution, namely to replace std=c++11
with std=gnu++11
in the call to g++
.
The accepted answer is hardly a solution. Having to set the C++ standard version should not be required.
I strongly suggest you try the MinGW-w64 GCC, which does not have this problem (or at least I haven't seen it reported or experienced it myself).
If you are working inside CODE::BLOCKS go to Settings->Compiler. Select 'compiler settings with GNU GCC compiler' under Selected Compiler. Check the option "Have g++ follow the C++14 ISO C++ language standard [-std=c++14]" in General menu.