Installing MinGW via Msys2 (Windows)

Introduction

There are several ways to install MinGW on Windows. One of the easiest methods is through MSYS2, a package management system that provides tools for installing, managing, and updating components from the GCC ecosystem on Windows. With MSYS2, you can easily set up and maintain packages such as CMake, GCC, MinGW, CPython, OpenSSL, FFmpeg, and many others, making it a more convenient option for Windows users.

Installing Msys2

Visit https://www.msys2.org and in the first step of their installation guide, click the download link (e.g. Download the installer: msys2-x86_64-20250622.exe). Install MSYS2 into your preferred folder and complete the setup process.

After that, skip the second step on their website, as it usually does not work. Instead, follow the instructions provided in the next step below.

Installing MinGW

Once the installation is complete, the installer will prompt you to run MSYS2. Click Yes to proceed. If you accidentally close it, you can launch it again from the installation folder by opening msys2.exe.

An important step that the official website does not mention is running the command:

pacman -Sy

This updates the repository list. Without this step, the installation command will fail. You may need to run the update command multiple times until no further updates are available.

Next, run the following command to install MinGW. Unlike the website’s guide, this will install the complete toolchain package set. When prompted to choose which package to install, simply press Enter to skip the selection and install everything:

pacman -S --needed base-devel mingw-w64-x86_64-toolchain

When you run the command, you’ll see an interface similar to the screenshot shown below.

Once the installation is complete, you can close MSYS2. To verify that MinGW was installed successfully, check whether the mingw folder contains files (for example: C:\msys64\mingw64\bin). If it’s not empty, the installation was successful.

Installing CMake

In addition, you can install CMake from the MSYS2 package manager if you don’t already have it installed:

pacman -S mingw-w64-x86_64-cmake

Let the process run for a while, and soon you’ll have CMake working together with MinGW

Setting System Environment Variable

On Windows, you need to add the MSYS2 MinGW path to the system PATH environment variable so that the Command Prompt can locate the MinGW and CMake executables. Navigate to Control Panel → System Properties → Environment Variables.

Afterwards, ensure that you add the proper path (e.g. C:\msys64\mingw64\bin) to the PATH environment variable, in either the System variables or User variables section.

That’s it! You can now try compiling the Kemena3D SDK or Kemena3D Studio. Happy coding!

Share the Post: