GCC 14 Installation Guide for Windows A comprehensive step-by-step guide to install GCC 14 on Windows using MinGW-w64 via MSYS2 or the Windows Subsystem for Linux (WSL).
This repository provides a comprehensive guide to installing GCC 14 on Windows using two different methods:
- MinGW-w64 via MSYS2
- Windows Subsystem for Linux (WSL)
Choose the method that best fits your development environment and preferences.
- Prerequisites
- Method 1: Using MinGW-w64 via MSYS2
- Method 2: Using Windows Subsystem for Linux (WSL)
- Troubleshooting
- License
- Windows 10 or later.
- Administrative privileges for installing software and modifying environment variables.
MinGW-w64 provides a complete Open Source programming toolset for developing native Windows applications.
- Navigate to the MSYS2 Official Website.
- Download the installer suitable for your system.
- Run the installer and follow the on-screen instructions to complete the installation.
- Launch the MSYS2 terminal (
MSYS2 MSYS
orMSYS2 MinGW 64-bit
). - Update the package database and core system packages by executing:
pacman -Syu
- If prompted, close and reopen the terminal.
- Run the update command again to ensure all packages are up to date:
pacman -Syu
- In the MSYS2 terminal, install GCC 14 by running:
Replace
pacman -S mingw-w64-x86_64-gcc
x86_64
withi686
if you need the 32-bit version.
-
Add the path to the GCC binaries to your system's
PATH
environment variable. Typically, this path is:C:\msys64\mingw64\bin
Adjust the path if you installed MSYS2 in a different location or are using a 32-bit setup.
-
To modify the
PATH
:- Press
Win + R
, typesysdm.cpl
, and press Enter. - Navigate to the Advanced tab and click on Environment Variables.
- Under System variables, find and select
Path
, then click Edit. - Click New and add
C:\msys64\mingw64\bin
. - Click OK to save changes.
- Press
- Open Command Prompt or PowerShell.
- Run the following command to check the GCC version:
gcc --version
- You should see output indicating that GCC version 14 is installed.
WSL allows you to run a Linux environment directly on Windows without the overhead of a virtual machine.
- Open PowerShell as an Administrator.
- Execute the following command to enable WSL:
wsl --install
- Restart your computer if prompted.
- After enabling WSL, open the Microsoft Store.
- Search for your preferred Linux distribution (e.g., Ubuntu) and install it.
- Launch the installed Linux distribution from the Start menu.
- Update the package lists and upgrade existing packages:
sudo apt update sudo apt upgrade -y
- Add the GCC toolchain PPA to get the latest GCC version:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update
- Install GCC 14 and its C++ counterpart:
sudo apt install gcc-14 g++-14
- Check the installed GCC version:
gcc-14 --version
- You should see output indicating that GCC version 14 is installed.
- MSYS2 Update Issues: If you encounter issues while updating MSYS2, ensure that you have a stable internet connection and that no antivirus software is blocking the update process.
- Environment Variable Not Set: After setting the
PATH
, ensure that you open a new terminal window for changes to take effect. - GCC 14 Not Found in Repositories: If GCC 14 is not available in the default repositories, check the MSYS2 or your Linux distribution's community resources for alternative installation methods.
This project is licensed under the MIT License.