Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MinGW g++ 4.8.1-4 doesn't recognize -std=c++14

I installed MinGW by following their home page to their sourceforge and using mingw-get-setup.exe. This installed g++ 4.8.1-4. GCC 4.8 is supposed to support C++14 with a command-line switch, but I just get an "unrecognized option" error.

Is this a bug with MinGW? With GCC? What can I do about it? Since I know someone will ask, I want C++14 for its for-each loops. I'm using iterators for now, but for-each would improve both readability and writability.

EDIT: Found out my g++ build supports c++11, so I can use for-each. But still no luck on c++14 support.

like image 815
LastStar007 Avatar asked Mar 15 '23 07:03

LastStar007


1 Answers

g++ 4.8 simply does not support C++14, also MinGW is quite outdated when there are more new versions of gcc.

Alternatives you can use

If you want really to use C++11 or C++14 on windows with gcc you should be using one of the following options:

  • https://msys2.github.io/ (Uses MinGW-w64 internally).
  • http://mingw-w64.org/doku.php (it supports 32-bits too).
  • http://tdm-gcc.tdragon.net/.
like image 78
Jean Pierre Dudey Avatar answered Mar 17 '23 20:03

Jean Pierre Dudey