How to Install GCC Compiler on Windows

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

Popular Posts You May Read

Explore more hosting insights, tips and industry updates.

How to Resolve Hotcopy Error in R1Soft Backup?

To resolve the hotcopy error, you can follow the following steps- We hope that by…

Steps to Enable and Disable SMBv1, SMBv2, and SMBv3 in Windows Servers

The following post shows detailed steps to enable and disable the Server Message Block (SMB)…

Incorrect login-Horde / Squirrelmail IMAP problem

The problem for incorrect login for Horde webmail OR the IMAP problem for Squirrelmail is…