Installing MinGW-w64 and Make on Windows#
This guide provides a step-by-step process to install Make and MinGW-w64 on Windows. By the end of this guide, you’ll be able to run Makefiles on Windows using 64-bit MinGW-w64 and GNU Make.
1. Download and Install MinGW-w64#
MinGW-w64 is a toolchain that enables the use of GNU tools (GCC, G++, Make, etc.) on Windows.
1.1 Download MinGW-w64#
Official download page: MinGW-w64
Alternatively, you can use the Winlibs version:
Recommendation:
- The Winlibs version is usually more up-to-date.
- Choose the x86_64-posix-seh variant for better exception handling.
1.2 Installing MinGW-w64#
- Extract the downloaded
.zip
file to a directory likeC:\mingw-w64
. - Note the path to the
bin
directory, for example:C:\mingw-w64\mingw64\bin
(This directory containsgcc.exe
,g++.exe
, etc.)
1.3 Add MinGW-w64 to the System PATH#
In the Windows Search Bar, type “View advanced system settings” and open it.
Go to the Advanced tab and click Environment Variables.
Under System variables, find the
Path
variable and click Edit.Click New and add the following path:
C:\mingw-w64\mingw64\bin
Press OK to save and exit all dialogs.
1.4 Verify MinGW-w64 Installation#
Open CMD or PowerShell and run:
gcc --version
g++ --version
You should see output like:
gcc (MinGW-W64 x86_64-posix-seh) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
If not, double-check your PATH configuration.