๐ŸŒ
GNU
gcc.gnu.org
GCC, the GNU Compiler Collection - GNU Project
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Objective-C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, and Algol 68 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system.
Installing GCC
The latest version of this document is always available at https://gcc.gnu.org/install/. It refers to the current development sources, instructions for specific released versions are included with the sources.
GCC mirror sites
If you limit access to your mirror ensure the gcc.gnu.org subnet is granted access.
GCC Releases
GCC releases may be downloaded from our mirror sites. Important: these are source releases, so will be of little use if you do not already have a C++ compiler installed. As one option, there are pre-compiled binaries.
Downloading GCC
The source distribution includes the Ada, C, C++, Objective-C, COBOL (GCC 15 and later), D (GCC 9 and later), Fortran, Go, Modula-2 (GCC 13 and later) and Algol 68 (GCC 16 and later, experimental) compilers, as well as runtime libraries for C++, Objective-C, COBOL, Fortran and Algol 68.
optimizing compiler produced by the GNU Project, key component of the GNU tool-chain and standard compiler for most projects related to GNU and the Linux kernel.
GCC_10.2_GNU_Compiler_Collection_self-compilation.png
gcc 11 1 0 compiling chicken screenshot
The GNU Compiler Collection (GCC) (formerly GNU C Compiler) is a collection of compilers from the GNU Project that support various programming languages, hardware architectures, and operating systems. The Free Software Foundation โ€ฆ Wikipedia
Factsheet
Original author Richard Stallman
Developer GNU Project
Initial release March 22, 1987; 38 years ago (1987-03-22)
Factsheet
Original author Richard Stallman
Developer GNU Project
Initial release March 22, 1987; 38 years ago (1987-03-22)
๐ŸŒ
Unraveldata
docs.unraveldata.com โ€บ unravel-v4796x โ€บ en โ€บ install-gcc-compiler.html
Installing GNU Compiler Collection (GCC)
GCC compiler version 4.9.3 must be installed. Check if you have already installed GCC. ... Install or update to the latest GCC version if not done already. Ensure to install from the Software Collections (SCL) repository. The SCL is available on CentOS 6.5. SCL repositories provide a package named Developer Toolset, which includes newer versions of the GNU ...
Discussions

macos - Install GNU GCC on Mac - Stack Overflow
I have recently become frustrated with the new Clang compiler included with Xcode 5. What would be the best way to install GNU GCC on OS X? Things to consider: I don't want to use MacPorts, Fink, More on stackoverflow.com
๐ŸŒ stackoverflow.com
GCC, the GNU Compiler Collection 15.1 released
The new default is -std=gnu23, which means C23's breaking changes are now the default. In my experience so far the most disruptive has been old-style prototypes, particularly empty parameter lists. This: void f(); Now means: void f(void); Instead of "unspecified number of arguments." Projects depending on the old behavior include GDB, GMP, GNU Make, and Vim. These require special consideration when building with GCC 15. More on reddit.com
๐ŸŒ r/C_Programming
51
60
April 25, 2025
How do I get a GCC?
On which OS? More on reddit.com
๐ŸŒ r/C_Programming
31
2
September 1, 2022
Why is GCC the only compiler that cares deeply about C?
Microsoft doesn't care about C. The win32 API is an ANSI C API and Windows programs haven't been written in C regularly since the Windows 3.x era. They lagged behind for a while, not implementing C99, but have since turned around and MSVC is C17 with more or less all the features. They even have a standards-compliant preprocessor now, available with a project setting or switch. It's weird that you have to specifically ask for the compliant preprocessor, but making that the default would break a lot of old projects. But anyway, you can do modern C in MSVC now, they're up to speed. Clang is more or less on par with GCC, and they both represent the state of the art of C. More on reddit.com
๐ŸŒ r/C_Programming
155
218
December 22, 2024
๐ŸŒ
Softonic
gcc-gnu-compiler-collection.en.softonic.com โ€บ home โ€บ windows โ€บ development & it โ€บ development kits โ€บ gcc gnu compiler collection
GCC GNU Compiler Collection - Download
June 29, 2022 - Compared to new compilers, its compilers are relatively slow and do not produce the most optimized code on the market. The GNU Compiler Collection, or GCC for short, is a development kit that initially handled only the C programming language.
Rating: 6/10 โ€‹ - โ€‹ 1 votes
๐ŸŒ
R Project
cran.r-project.org โ€บ doc โ€บ manuals โ€บ r-patched โ€บ R-admin.html
R Installation and Administration
So if you want to specify a non-default standard use something like -std=gnu17. Compiling R requires C99 or later: C11 and C17 are minor updates, but the substantial update โ€˜C23โ€™ (finally published in October 2024) is also supported for recent versions of GCC14, clang15 and Intel icx.
๐ŸŒ
GitHub
github.com โ€บ gcc-mirror โ€บ gcc
GitHub - gcc-mirror/gcc
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details.
Starred by 10.7K users
Forked by 4.7K users
Languages ย  C++ 30.1% | C 29.3% | Ada 14.0% | D 5.9% | Go 5.3% | HTML 3.6%
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ GNU_Compiler_Collection
GNU Compiler Collection - Wikipedia
3 weeks ago - The GNU Compiler Collection (GCC) (formerly GNU C Compiler) is a collection of compilers from the GNU Project that support various programming languages, hardware architectures, and operating systems.
Find elsewhere
Top answer
1 of 4
11

Homebrew now has the GCC package so you can install it with this command:

brew install gcc
2 of 4
7

The way I do it is:

  1. Download the source for GCC and numerous supporting packages. The instructions are in the gcc-4.x.y/INSTALL/index.html file in the GCC source code, or online at http://gcc.gnu.org/install/.
  • GNU Multiple Precision Library (GMP) version 4.3.2 (or later) from http://gmplib.org/.
  • MPFR Library version 2.4.2 (or later) from http://www.mpfr.org/.
  • MPC Library version 0.8.1 (or later) from http://www.multiprecision.org/.
  • ISL Library version 0.11.1 from ftp://gcc.gnu.org/pub/gcc/infrastructure/.
  • CLooG 0.18.0 from ftp://gcc.gnu.org/pub/gcc/infrastructure/.
  1. Use a script to extract the source for GCC and the support libraries into a directory, create the object directory, and run the build.

This is the script I used for GCC 4.8.2:

GCC_VER=gcc-4.8.2
tar -xf ${GCC_VER}.tar.bz2 || exit 1

(
cd ${GCC_VER} || exit

cat <<EOF |
    cloog 0.18.0 tar.gz
    gmp 5.1.3 tar.xz
    isl 0.11.1 tar.bz2
    mpc 1.0.1 tar.gz
    mpfr 3.1.2 tar.xz
EOF

while read file vrsn extn
do
    (
    set -x
    tar -xf "../$file-$vrsn.$extn" &&
    ln -s "$file-$vrsn" "$file"
    )
done
)

mkdir ${GCC_VER}-obj
cd ${GCC_VER}-obj
../${GCC_VER}/configure --prefix=$HOME/gcc/gcc-4.8.2
make -j8 bootstrap

When that finishes, run the install too. Then add $HOME/gcc/gcc-4.8.2/bin (the name you specify in --prefix plus /bin) to your PATH ahead of /usr/bin.

With a decent MacBook Pro with a 5400 rpm spinning disk, it takes an hour or two to compile everything (using the -j8 option to make), and requires multiple gigabytes of disk space while compiling. SSD is nice when doing this (definitely faster)!


GCC 4.9.0 was released on 2014-04-22. I've installed it using basically the same process, but with CLooG 0.18.1 and ISL 0.12.2 (required updates) and GMP 5.1.3 (and 6.0.0a), MPC 1.0.2 (or 1.0.1) and MPFR 3.1.2 on Mac OS X 10.9.2 Mavericks and an Ubuntu 12.04 (Precise Pangolin) derivative. Beware that the gmp-6.0.0a.tar.xz extracts into directory gmp-6.0.0 (not gmp-6.0.0a as you might expect).


Between 2014 and 2017-09-27, I've built GCC versions 4.9.0, 4.9.1, 5.1.0, 5.2.0, 5.3.0, 6.1.0, 6.2.0, 6.3.0, 7.1.0 with only minor variations in the build script shown below for GCC 7.2.0 on macOS v10.12 (Sierra). The versions of the auxiliary libraries changed reasonably often.


macOS Sierra and High Sierra

On 2017-08-14, I used a minor variant of the script above to build GCC 7.2.0 on macOS v10.12 (Sierra) (using Xcode 8 as the bootstrap compiler). One change is that CLooG doesn't seem to be needed any more (I stopped adding it with GCC 6.2.0). This is my current script:

#!/bin/bash

#export DYLD_LIBRARY_PATH=$(clnpath $(dirname $(dirname $(which g++)))/lib:$DYLD_LIBRARY_PATH)
unset DYLD_LIBRARY_PATH

TAR=/opt/gnu/bin/tar
VER_NUM=7.2.0
GCC_VER=gcc-${VER_NUM}
TGT_BASE=/opt/gcc
TGT_DIR=${TGT_BASE}/v${VER_NUM}
CC=/usr/bin/clang
CXX=/usr/bin/clang++

extract() {
    echo "Extract TAR -xf $1
}

if [ ! -d "$GCC_VER" ]
then extract ${GCC_VER}.tar.xz || exit 1
fi

(
cd ${GCC_VER} || exit

nbncl <<EOF |
    gmp     6.1.2   tar.lz
    isl     0.16.1  tar.bz2
    mpc     1.0.3   tar.gz
    mpfr    3.1.5   tar.xz
EOF

while read file vrsn extn
do
    tarfile="../$file-$vrsn.$extn"
    if [ ! -f "$tarfile" ]
    then echo "Cannot find $tarfile" >&2; exit 1;
    fi
    if [ ! -d "$file-$vrsn" ]
    then
        (
        set -x
        extract "$tarfile" &&
        ln -s "$file-$vrsn" "$file"
        ) || exit 1
    fi
done
)

if [ $? = 0 ]
then
    mkdir ${GCC_VER}-obj
    cd ${GCC_VER}-obj
    ../${GCC_VER}/configure --prefix="${TGT_DIR}" \
        CC="{CXX}"
    make -j8 bootstrap
fi

Make sure your version of tar supports all four different compressed file formats (.lz, .gz, .xz, .bz2), but since the standard Mac version of tar does that for me, it'll probably work for you too.

On 2017-09-27, I failed to build GCC 7.2.0 on macOS v10.13 (High Sierra) (using Xcode 9 for the bootstrap compiler) using the same script as worked on v10.12 (Sierra). The immediate error was a missing header <stack>; I'll need to track down whether my Xcode 9 installation is correct โ€” or, more accurately, why it isn't correct since <stack> is a standard header in C++98 onwards. There's probably an easy fix; I just haven't spent the time chasing it yet. (Yes, I've run xcode-select --install multiple times; the fact that I had to run it multiple times because of network glitches may be part of the trouble.) (I got GCC 7.2.0 to compile successfully on 2017-12-02; I don't recall what gymnastics โ€” if any โ€” were required to get this to work.)

Time passes; version numbers increase. However, the basic recipe has worked for me with more recent versions of GCC. I have 7.3.0 (installed 2018-01-2), 8.1.0 (installed 2018-05-02), 8.2.0 (installed 2018-07-26), 8.3.0 (installed 2019-03-01) and now 9.1.0 (installed today, 2019-05-03). Each of these versions was built and installed on the current version of macOS at the time, using the current version of Xcode for the bootstrap phase (so using macOS v10.14.4 (Mojave) and Xcode 10.2.1 when building GCC 9.1.0).

๐ŸŒ
Fsu
sc.fsu.edu โ€บ home โ€บ computing โ€บ tech docs
GNU Compiler Collection (GCC) - Department of Scientific Computing
The GNU Complier Collection (GCC) is an integrated compiler that can compile programs written in C, C++, and Fortran. GCC is both the most general name for the compiler suite, and the name used when the emphasis is on compiling C programs (as the abbreviation formerly stood for "GNU C Compiler").
๐ŸŒ
mingw-w64
mingw-w64.org โ€บ downloads
Pre-built Toolchains - mingw-w64
mingw-w64 GCC : compilers, linker, assembler ยท GDB : debugger ยท GNU Make : standard build tool ยท busybox-w32 : standard unix utilities, including sh ยท Vim : powerful text editor ยท Universal Ctags : source navigation ยท The toolchain includes pthreads, C++11 threads, and OpenMP.
๐ŸŒ
CodeWithHarry
codewithharry.com โ€บ blogpost โ€บ how-to-install-gnu-gcc-compiler-on-windows
How to install gnu gcc compiler for C Language on Windows | Blog | CodeWithHarry
You've now successfully set up gcc on Windows 11, enabling you to create C/C++ applications seamlessly. These steps cover the entire process, from installing the gcc and g++ compilers to executing your programs in the command prompt. Should you encounter any inquiries or difficulties, feel free to reach out via the comments section.
๐ŸŒ
Incredibuild
incredibuild.com โ€บ home โ€บ integrations โ€บ gcc
What is GNU Compiler Collection (GCC) | Incredibuild
September 17, 2024 - The GNU Compiler Collection, commonly known as GCC, is a set of compilers and development tools available for Linux, Windows, various BSDs, and a wide assortment of other operating systems.
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ cpp โ€บ config-mingw
Using GCC with MinGW
November 3, 2021 - Get the latest version of MinGW-w64 via MSYS2, which provides up-to-date native builds of GCC, MinGW-w64, and other helpful C++ tools and libraries. This will provide you with the necessary tools to compile your code, debug it, and configure it to work with IntelliSense.
๐ŸŒ
Admb-project
admb-project.org โ€บ tools โ€บ gcc
GCC for Windows
Version 4.9.2 of the GNU compiler (C/C++) for 64-bit Windows. Prepared by Arni Magnusson, based on tdm-gcc.
๐ŸŒ
Dev-C++
bloodshed-dev-c.en.softonic.com โ€บ home โ€บ windows โ€บ development & it โ€บ programming languages โ€บ dev-c++
Dev-C++ - Download
November 3, 2025 - Dev-C++ is a free, open-source development and IT program that simplifies the programming process for C and C++. This program uses minimal computer resources, making it a good choice for older systems.
Rating: 8.1/10 โ€‹ - โ€‹ 14.2K votes
๐ŸŒ
Tamu
hprc.tamu.edu โ€บ kb โ€บ Software โ€บ GNU-Compiler-Collection
GNU Compiler Collection (GCC) - Texas A&M HPRC
The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project. GCC is a key component of the GNU toolchain and the standard compiler for most projects related to GNU and the Linux kernel.
๐ŸŒ
WinLibs
winlibs.com
WinLibs - GCC+MinGW-w64 compiler for Windows
In short: it's a free C and C++ compiler for Microsoft Windows. GCC (GNU Compiler Collection) is a free and open source compiler for C and C++ (and other languages like Objective-C, Fortran, D). MinGW-w64 is a free and open source C library for targetting Windows 32-bit and 64-bit platforms.
๐ŸŒ
GNU
gnu.org โ€บ software โ€บ gcc
GCC, the GNU Compiler Collection - GNU Project
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, D, Modula-2, and COBOL as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system. The GNU system was developed to be 100% free software, ...
๐ŸŒ
GNU
gnu.org โ€บ philosophy โ€บ free-sw.en.html
What is Free Software? - GNU Project - Free Software Foundation
Since 1983, developing the free Unix style operating system GNU, so that computer users can have the freedom to share and improve the software they use.
๐ŸŒ
Red Hat
docs.redhat.com โ€บ en โ€บ documentation โ€บ red_hat_developer_toolset โ€บ 9 โ€บ html โ€บ user_guide โ€บ chap-gcc
Chapter 2. GNU Compiler Collection (GCC) | User Guide | Red Hat Developer Toolset | 9 | Red Hat Documentation
In Red Hat Developer Toolset, the GNU C++ compiler is provided by the devtoolset-9-gcc-c++ package and is automatically installed with the devtoolset-9-toolchain package as described in Section 1.5, โ€œInstalling Red Hat Developer Toolsetโ€.
๐ŸŒ
NTU
www3.ntu.edu.sg โ€บ home โ€บ ehchua โ€บ programming โ€บ cpp โ€บ gcc_make.html
GCC and Make - A Tutorial on how to compile, link and build C/C++ applications
GCC is a key component of so-called "GNU Toolchain", for developing applications and writing operating systems. The GNU Toolchain includes: GNU Compiler Collection (GCC): a compiler suite that supports many languages, such as C/C++ and Objective-C/C++.