# msys2: Unknown platform using MSYS2-MINGW32 in Windows 10

**URL:** https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521
**Category:** Usage
**Created:** [November 21, 2021, 9:30pm UTC](https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521 "2021-11-21T21:30:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Richard\_Dobson](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/8e8cbc/32.png) [@Richard\_Dobson](https://discourse.cmake.org/u/Richard_Dobson)
#### Post date: [November 21, 2021, 9:30pm UTC](https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521/1 "2021-11-21T21:30:58Z")

</div>

Hello,

I am building a large cross-platform suite of commandline programs, no  
issues with older MINGW on Win7 (32bit) system - Cmake recognises  
platform id MINGW.

Now trying MINGW32 on Windows 10 (64bit OS, but I a targetting 32bit  
WIN32), Cmake (v 3.21.1) reports this error:

System is unknown to cmake, create:  
Platform/MINGW32\_NT-10.0-19043

Of course, I need a working CMake ID for the platform, so that  
appropriate flags and symbols are passed to the compiler.

I have attached my CopyOfCmakeCache.txt as instructed in error message.

I welcome any solution, even if a workaround to begin with.

Richard Dobson  
Composers Desktop Project

[CopyOfCMakeCache.txt](https://discourse.cmake.org/uploads/short-url/kyyf8S5f5wAh0OCV6mZf12mVdqQ.txt) (15.8 KB)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 22, 2021, 11:38am UTC](https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521/2 "2021-11-22T11:38:08Z")

</div>

Cc: @brad.king

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [November 22, 2021, 3:11pm UTC](https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521/3 "2021-11-22T15:11:52Z")

</div>

MSYS2 comes with two variants of cmake: one that targets the msys2 runtime, and one that targets Windows with the GNU ABI (mingw). Which cmake package are you using?

---

<div class="post-metadata">

### Author: ![Richard\_Dobson](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/8e8cbc/32.png) [@Richard\_Dobson](https://discourse.cmake.org/u/Richard_Dobson)
#### Post date: [November 22, 2021, 4:38pm UTC](https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521/4 "2021-11-22T16:38:43Z")

</div>

Thank you for a very quick reply. Sorry but I am relatively new to  
MinGW generally, and vey new indeed to MSYS2 etc on Windows 10.

The requirement is to target Windows ( this is an LGPL github  
distribution, the Cmakefiles support Mac and Linux too).

I installed msys2 using downloaded msys2-x86\_64-20210725.exe, which gave  
me four options in the Windows taskbar under “MSYS2 64bit” - including  
MSYS2-minGW 32-bit and MSYS2 MinGW 64bit, the former ostensibly the one  
I need to use.

Nothing much seemed available immediately, I had to use ‘pacman’ for all  
of gcc, git and Cmake - I simply asked for 'cmake", not knowing what  
other name options might be available. That is the cmake which proved  
to offer no Generators for MinGW or MSVC. So I assume that is the answer  
to your question, it must be the msys2 version.

At the moment, I have uninstalled the pacman cmake, and installed the  
standard external Windows CMake from cmake.og, which has all the  
expected Generators including Mingw32, and suffice it to say I have now  
successfully built all programs for 32bit WIN32 using our existing  
CMakefiles. But I would like to be able to use the “internal” MinGW-32  
cmake, etc as it seems much tidier, self-contained - less to document  
for users, ideally.

Thanks you,

Richard Dobson  
Composers Desktop Project

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [November 22, 2021, 4:46pm UTC](https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521/5 "2021-11-22T16:46:33Z")

</div>

One can use `pacman -Ss cmake` to search for packages related to cmake. There are three packages of CMake itself:

- mingw32/mingw-w64-i686-cmake
- mingw64/mingw-w64-x86\_64-cmake
- msys/cmake

Each of those is named based on the runtime environment and ABI for which it was built. You probably want `mingw32/mingw-w64-i686-cmake`.

Be sure to have `/mingw32/bin` near the front of your `PATH` to get the toolchain that targets 32-bit MinGW.

---

<div class="post-metadata">

### Author: ![Richard\_Dobson](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/8e8cbc/32.png) [@Richard\_Dobson](https://discourse.cmake.org/u/Richard_Dobson)
#### Post date: [November 22, 2021, 5:03pm UTC](https://discourse.cmake.org/t/msys2-unknown-platform-using-msys2-mingw32-in-windows-10/4521/6 "2021-11-22T17:03:20Z")

</div>

Thank you. That does indeed present a dizzyingly long list. Yes, I  
already have mingw32/bin at the head of PATH.

Richard
