How to Install GCC Compiler on Windows, macOS, and Linux: A Step‑by‑Step Guide
Get a reliable C/C++ development environment on any platform with GCC. This guide walks you through installing GCC on Windows, macOS, and Linux, using Code::Blocks for Windows and native package managers for Unix‑like systems.
Install GCC on Windows
We’ll use Code::Blocks, an open‑source IDE that bundles the GCC compiler, an editor, and a debugger into a single package.
Step 1: Download Code::Blocks
Visit the Code::Blocks download page and choose the Binary Release.
Step 2: Select the GCC Installer
Pick the installer that includes the MinGW GCC compiler, for example codeblocks-17.12mingw-setup.exe. This package contains GCC, GDB, and all the necessary source files.
Step 3: Run the Installer
Execute the downloaded file and follow the on‑screen prompts. Accept the default options to install GCC and the associated tools.
Step 4: Accept the License
Agree to the end‑user license agreement when prompted.
Step 5: Keep the Default Component Selection
Leave the component list unchanged and click Next to proceed.
Step 6: Choose the Installation Path
Specify the folder where you want Code::Blocks and GCC installed (or accept the default) and click Next.
Step 7: Launch Code::Blocks
After installation, double‑click the Code::Blocks icon to start the IDE.
Step 8: Verify GCC Detection
On first launch, Code::Blocks automatically detects the bundled GCC compiler and sets it as the default. You can confirm this in Settings > Compiler.
Step 9: Start Coding
You’re now ready to create, compile, and debug C/C++ projects in a fully integrated environment.
Install GCC on Linux
Most Linux distributions ship GCC preinstalled. Verify the installation by running:
gcc --version
If GCC is missing, use your distribution’s package manager:
- Red‑Hat/Fedora:
# yum groupinstall 'Development Tools' - Debian/Ubuntu:
$ sudo apt-get update $ sudo apt-get install build-essential manpages-dev
After installation, confirm the compiler’s presence with gcc --version again.
Install GCC on macOS
Apple’s Command Line Tools include GCC. Follow these steps:
- Navigate to Apple Developer Downloads (you’ll need a free Apple ID).
- Download the latest Command Line Tools for Xcode (the
.dmgfile). - Open the .dmg and run the installer, accepting all default settings.
- Open Terminal and execute
gcc -vto verify that GCC is available.
Conclusion
With GCC installed, you can develop C/C++ applications on any platform. For Windows, Code::Blocks offers an all‑in‑one IDE; on Linux and macOS, the native compilers are lightweight and fully supported by your package manager. Happy coding!
C Language
- Free VHDL Simulator & Editor Setup: A Student’s Guide
- Installing Dev‑C++ on Windows: Step‑by‑Step Guide
- Installing Visual Studio 2019 Community Edition for C# Development on Windows
- How to Download and Install Java JDK 8 on Windows 10 (64‑Bit) – Step‑by‑Step Guide
- Step‑by‑Step Guide: Downloading and Installing Eclipse IDE for Java
- How to Install Oracle Java on Ubuntu Linux – Step‑by‑Step Guide
- Install Python and PyCharm on Windows: Step‑by‑Step Guide
- Setting Up Your C Programming Environment: Essential Tools & Tips
- E3.Student – Free Study Edition for Engineering Students
- Synergizing Industry 4.0 and IIoT: Driving Digital Transformation in Manufacturing & Beyond