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
- ownload MinGW from https://osdn.net/projects/mingw/.
- Run the installer and open MinGW Installation Manager.
- In the package list, find and mark the following for installation:
- mingw32-base
- mingw32-gcc-g++
- Add the path C:\MinGW\bin to System Environment Variables → Path.
- Open Command Prompt and verify with:
gcc --version
Option 2: Install Using MSYS2
- ownload MSYS2 from https://www.msys2.org/.
- Open MSYS2 MSYS terminal and update packages:
pacman -Syu pacman -Su - Install GCC:
pacman -S mingw-w64-x86_64-gccAdd C:\msys64\mingw64\bin to your system Path.
- 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