How to Install GCC Compiler on Windows

November 6, 2025 / Tutorial

The GCC (GNU Compiler Collection) is a widely used open-source compiler that supports C, C++, and several other programming languages. Although it’s primarily designed for Linux systems, it can be easily installed on Windows through tools like MinGW or MSYS2.

Follow the guide:

Option 1: Install Using MinGW

  1. ownload MinGW from https://osdn.net/projects/mingw/.
  2. Run the installer and open MinGW Installation Manager.
  3. In the package list, find and mark the following for installation:
    • mingw32-base
    • mingw32-gcc-g++
  4. Add the path C:\MinGW\bin to System Environment Variables → Path.
  5. Open Command Prompt and verify with:
    gcc --version

Option 2: Install Using MSYS2

  1. ownload MSYS2 from https://www.msys2.org/.
  2. Open MSYS2 MSYS terminal and update packages:
    pacman -Syu
    pacman -Su
  3. Install GCC:
    pacman -S mingw-w64-x86_64-gcc

    Add C:\msys64\mingw64\bin to your system Path.

  4. Verify with:
    gcc --version
Troubleshooting
  • ‘gcc’ not recognized: Check if the correct bin path is added to your Path variable.
  • Permission errors: Run the terminal as an administrator.

In this manner, you can install GCC on Windows quickly using MinGW or MSYS2. Once installed, you can compile C/C++ programs directly from the Command Prompt or your preferred IDE.

Learn more tutorials about How to Allow Customers Compiler Access Using WHM