4

I need a compiler that supports c++20, like GCC 10.1 (used on linux), but to use it in my Windows 10.

I saw posts that recommend Mingw-w64, but does it supports c++20?

bakun
  • 448
  • 1
  • 9
  • 17
  • 1
    Windows 10 can now run Linux in a container. Just run Linux. It's the simplest answer. Why struggle trying to cram a complex piece of software into some alien operating system that it was not designed for? – Sam Varshavchik May 15 '20 at 03:51
  • Could you explain me or give a link on how to "run Linux in a container" plz – bakun May 15 '20 at 03:54
  • 1
    Searching for "linux container in windows 10" on www.google.com let me straight to Microsoft's documentaiton for doing so. – Sam Varshavchik May 15 '20 at 04:02
  • There's a table of C++ feature support by version in the following link. Seems MSVC has rather complete support, and is available for free. https://en.cppreference.com/w/cpp/compiler_support, – Uri Raz Mar 08 '22 at 19:31

2 Answers2

6

In the meantime GCC 10 has been released and MinGW builds are available.

You can download a standalone build of MinGW-w64 with GCC 10 for Windows 32-bit and 64-bit from http://winlibs.com/

Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40
2

You can install Clang and MSVC/Visual Studio on Windows directly. For gcc you need MinGw /Msys2. I use wsl. With wsl you can check out gcc trunk and build it yourself.

C++20 is not completely supported but you can use most of it like coroutines, concepts...

Other compilers usually lack behind those.

Bernd
  • 2,113
  • 8
  • 22
  • Btw: here you can find a good tutorial how to compile GCC on your own here: https://solarianprogrammer.com/2016/10/07/building-gcc-ubuntu-linux/ Just download the current source and adjust the config-command. The GCC source is available here: https://github.com/gcc-mirror/gcc/archive/master.zip – Bernd Jul 01 '20 at 11:13