DEV Community

Cover image for How to Install the New Version of GCC MinGW on Windows
Marcos Oliveira
Marcos Oliveira

Posted on

How to Install the New Version of GCC MinGW on Windows

We previously published a post about installing GCC MinGW on Windows, but it has become outdated — it was the old version: 8.1.0.

In this short article, we’ll see how to update or install it (if you haven’t already) the easy way.


Installation

If you installed the version from the previous article

First, remove (or rename) the folder:

Open PowerShell with administrator privileges.

To rename:

Rename-Item -Path "C:\mingw64" -NewName "mingw64-old"
Enter fullscreen mode Exit fullscreen mode

Or to remove the installation:

Remove-Item -Path "C:\mingw64" -Recurse -Force
Enter fullscreen mode Exit fullscreen mode

Now just download the compressed file from:

Or direct download:
https://sourceforge.net/projects/winlibs-mingw/files/latest/download

Extract the file

If extracting it didn’t create the mingw32 folder, it’s because it’s inside the folder:
winlibs-i686-mcf-dwarf-gcc-15.1.0-mingw-w64ucrt-12.0.0-r1/.

Move it to drive C:\:

Move-Item -Path "mingw32" -Destination "C:\"
Enter fullscreen mode Exit fullscreen mode

Rename it to mingw64:

Rename-Item -Path "C:\mingw32" -NewName "mingw64"
Enter fullscreen mode Exit fullscreen mode

Add to the PATH system variable

Do this only if this is your first installation. If you’re updating from the previous article’s procedure, you don’t need to.

Open the terminal with administrator privileges and run the command below:

[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\mingw64", "Machine")
Enter fullscreen mode Exit fullscreen mode

Now check the version by running:

If this is your first installation, close and reopen the terminal!

g++ --version
Enter fullscreen mode Exit fullscreen mode

15.1.0

The full output will be:

g++.exe (MinGW-W64 i686-ucrt-mcf-dwarf, built by Brecht Sanders, r1) 15.1.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Enter fullscreen mode Exit fullscreen mode

This version is available at https://winlibs.com, which links to the same SourceForge page, but there are other versions there for different setups.

If you want to use the make command, remember to rename it from C:\mingw64\bin\mingw32-make to C:\mingw64\bin\make.

Rename-Item -Path "C:\mingw64\bin\mingw32-make" -NewName "make"
Enter fullscreen mode Exit fullscreen mode

See also:

Top comments (0)