MXE (M cross environment) is a GNU Makefile that builds a MinGW-w64 cross compiler and cross-compiles libraries such as SDL and Qt on Unix hosts.
Overview
MXE (M cross environment) is a GNU Makefile project that assembles a cross-compiling toolchain and builds many third-party libraries for Windows targets. It uses the MinGW-w64 runtime and supports host triplets such as i686-w64-mingw32 and x86_64-w64-mingw32, with static and shared library variants.
The environment is meant to run on Unix systems. Users drive builds with make, optionally limiting work to a subset of packages; dependencies are built automatically. Source packages are downloaded and verified with checksums, and parallel builds are used where possible. The build integrates with autotools, cmake, qmake, and hand-written makefiles, and includes ccache to speed repeated builds.
Typical targets include 32-bit and 64-bit Windows executables, either statically linked into one binary or split into an executable with dependent DLLs. OpenMP and winpthreads are always available. Pre-compiled binaries are offered for use in continuous integration, and Debian and Ubuntu users can install toolchain packages from an MXE APT repository instead of compiling everything from source.
After installation, users adjust PATH to the MXE usr/bin directory and use target-prefixed tools such as cross GCC and pkg-config helpers. The project path must not contain whitespace, and MXE is not relocatable once initial packages have been built.
Key features
- MinGW-w64 cross compiler toolchains
- Cross-builds SDL, Qt, and many libraries
- Checksum-verified source downloads
- Subset builds with automatic dependencies
- Parallel inter- and intra-package builds
- autotools, cmake, and qmake integration
- Pre-built binaries and APT packages
- ccache bundled for faster rebuilds
Use cases
- Cross-compiling GTK projects to Windows
- Building static or shared Windows executables on Unix
- Installing only needed MXE packages via make
- CI builds using pre-compiled MXE binaries