This guide explains how to build and install GNUstep on Windows 10 using the MSYS2 MinGW-w64 (mingw64_nt) environment.
- Install MSYS2 (MinGW-w64 64-bit)
- Update MSYS2 packages
- Clone this repository (or use your local copy)
- Run the repository helper scripts:
install-dependencies-mingw64_nt,setup-mingw64_nt,build-mingw64_nt, andpost-install-mingw64_nt - Verify the installation with small smoke tests
- Windows 10 (64-bit)
- Administrative privileges for installing some packages (when required)
- Internet access for
pacmanandgit - Recommended free disk space: 10–30 GB (builds can be large)
Note: Use the "MSYS2 MinGW 64-bit" shell supplied by MSYS2 (this is the mingw64 environment). Do not use the plain MSYS shell, PowerShell, or CMD for the build steps.
- Download the MSYS2 installer from https://www.msys2.org/.
- Run the installer and follow the instructions (default installation path is recommended).
- Open the "MSYS2 MinGW 64-bit" shortcut from the Start menu. This opens the mingw64 environment we need.
In the MSYS2 MinGW 64-bit shell run:
# Update the package database and core system packages (may ask to restart the shell)
pacman -Syu
# After closing and re-opening the MSYS2 MinGW 64-bit shell (if pacman requested it), finish updates:
pacman -SuIf pacman asks you to restart the shell while running -Syu, close and re-open the MSYS2 MinGW 64-bit shell and run pacman -Su again.
To avoid CRLF problems with shell scripts in the repo, configure Git inside MSYS2:
# inside MSYS2 MinGW 64-bit shell
git config --global core.autocrlf falseOr clone with the option:
git -c core.autocrlf=false clone https://github.com/gnustep/tools-scripts.gitMSYS2 typically provides git. If it is not installed, install it and clone:
# inside MSYS2 MinGW 64-bit shell
pacman -S --needed git
git clone https://github.com/gnustep/tools-scripts.git
# Do not change directory; we'll invoke the helper scripts by path (./tools-scripts/)If you already have a local copy of the repository, cd into that folder instead.
This repository includes helper scripts specifically for the mingw64 target:
install-dependencies-mingw64_nt— installs required MSYS2/Mingw packages viapacmansetup-mingw64_nt— configures GNUstep Makefiles and environmentbuild-mingw64_nt— builds the GNUstep stackpost-install-mingw64_nt— optional post-install tasks
Run them from the MSYS2 MinGW 64-bit shell in the repository root:
chmod +x ./tools-scripts/install-dependencies-mingw64_nt ./tools-scripts/setup-mingw64_nt ./tools-scripts/build-mingw64_nt ./tools-scripts/post-install-mingw64_nt
./tools-scripts/install-dependencies-mingw64_ntNotes:
- The script will call
pacmanto install required packages (GCC, make, pkg-config, cmake, etc.). Let it run and install. - If you prefer, open
install-dependencies-mingw64_ntto see the package list and install them manually withpacman -S.
Run the setup script from the repository root:
./tools-scripts/setup-mingw64_ntThis script typically:
- Creates or copies GNUstep Makefiles into
/mingw64/etc/GNUstep/Makefiles(or the appropriate MinGW prefix) - Produces helper shell fragments you can
sourceto get GNUstep environment variables
If the script prints the path to a helper file (for example gnustep_env.sh), source it to set up the environment in your current shell. Example:
# example; follow the actual file the script prints
source /mingw64/etc/GNUstep/Runtime/gnustep.sh || true
# or if the script wrote a helper inside the repo
source ./gnustep-env.shIf the script does not produce a sourceable file, it will at least set up Makefiles and other configuration files required by the build.
Use the build driver to build the GNUstep components:
# From repository root inside MSYS2 MinGW 64-bit shell
./tools-scripts/build-mingw64_ntNotes:
- Building everything can take a long time (hours on slower machines).
- Scripts commonly honor
MAKEFLAGSor accept-joptions. For example, to build with 4 jobs:
MAKEFLAGS='-j4' ./build-mingw64_nt- If the build fails, capture the first error in the logs — typical causes are missing packages, wrong shell (not using mingw64), or antivirus interference.
If the repository provides a post-install-mingw64_nt script, run it to perform final packaging or copy the built artifacts into their final locations:
./tools-scripts/post-install-mingw64_ntReview the script to see whether it installs into /mingw64, a staging area, or creates packages.
- Confirm toolchain and paths:
which gcc
gcc --version
which make
make --version
ls /mingw64/bin | grep -Ei 'gcc|g\+\+|gnustep'- Build and run a tiny native example to ensure
gccworks:
cat > hello.c <<'EOF'
#include <stdio.h>
int main(void){ puts("Hello from mingw64"); return 0; }
EOF
gcc -o hello.exe hello.c
./hello.exe- If you built GNUstep libraries, try compiling a tiny Objective-C example or running any small GNUstep tool the build produced. The exact test depends on which components you built.
- Wrong shell: ensure you're using the "MSYS2 MinGW 64-bit" shell.
pacmanslow or failing: try again and consider changing mirrors in/etc/pacman.d/mirrorlist.- Git CRLF issues: set
core.autocrlf=falseor re-clone with that option. - Antivirus: temporarily whitelist MSYS2 and the build folders during builds.
- Path length problems: enable long paths in Windows 10 (Group Policy or registry) if you see path-length errors.
- Disk space: builds can be large; free more space or build only the components you need.
- Permission errors for
pacman -S: run the MSYS2 shell as Administrator if required. - For build failures, inspect logs around the first error. Missing headers indicate missing
mingw-w64-x86_64-*-devpackages (install the correspondingmingw-w64-x86_64-...pacman package).
- Use parallel builds with
MAKEFLAGS='-jN'or pass-jNto supportedmakeinvocations. - Build only the components you need (edit
build-mingw64_ntor run component-specific targets) to save time. - Use an SSD and multiple cores for significantly faster builds.
install-dependencies-mingw64_nt— installs MSYS2/mingw packages viapacman.setup-mingw64_nt— configures GNUstep Makefiles and environment for mingw64.build-mingw64_nt— builds the GNUstep stack for mingw64.post-install-mingw64_nt— post-installation and packaging tasks.
Run those scripts from the repository root inside the MSYS2 MinGW 64-bit shell.
Open the MSYS2 MinGW 64-bit shell and run the following commands:
# update system
pacman -Syu
# reopen shell if pacman requested it, then finish updates
pacman -Su
# install git if needed, clone repo
pacman -S --needed git
git -c core.autocrlf=false clone https://github.com/gnustep/tools-scripts.git
# invoke helper scripts from the repository path (do not cd into it)
chmod +x ./tools-scripts/install-dependencies-mingw64_nt ./tools-scripts/setup-mingw64_nt ./tools-scripts/build-mingw64_nt ./tools-scripts/post-install-mingw64_nt
./tools-scripts/install-dependencies-mingw64_nt
./tools-scripts/setup-mingw64_nt
# optional: parallel build (adjust -j to match your CPU)
MAKEFLAGS='-j4' ./tools-scripts/build-mingw64_nt
./tools-scripts/post-install-mingw64_ntIf you want, I can:
- Inspect the
install-dependencies-mingw64_nt,setup-mingw64_nt, andbuild-mingw64_ntscripts in this repository and produce a tailored command list. - Add a short Windows-specific README or integrate this file into the repo's main
README.mdwith a link. - Help debug build failures — paste the first error and I'll analyze it and propose fixes.
File added on: October 11, 2025