On Linux

mingw Tool Chain

Search for the specific package to install

apt-cache search mingw-

Installing

# x64 cross-compile tools
sudo apt install g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64

# Using ucrt library
sudo apt install g++-mingw-w64-ucrt64 gcc-mingw-w64-ucrt64

Compile

# Simple compile
x86_64-w64-mingw32-gcc hello.c -o hello.exe

On Windows

mingw Tool Chain

https://code.visualstudio.com/docs/cpp/config-mingw

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