EDIT Since not so recently by now, MinGW-w64 has "absorbed" one of the toolchain building projects. The downloads can be found here. The installer should work, and allow you to pick a version that you need.

Note the Qt SDK comes with the same toolchain. So if you are developing in Qt and using the SDK, just use the toolchain it comes with.

Another alternative that has up to date toolchains comes from... harhar... a Microsoft developer, none other than STL (Stephan T. Lavavej, isn't that a spot-on name for the maintainer of MSVC++ Standard Library!). You can find it here. It includes Boost.

Another option which is highly useful if you care for prebuilt dependencies is MSYS2, which provides a Unix shell (a Cygwin fork modified to work better with Windows pathnames and such), also provides a GCC. It usually lags a bit behind, but that is compensated for by its good package management system and stability. They also provide a functional Clang with libc++ if you care for such thing.

I leave the below for reference, but I strongly suggest against using MinGW.org, due to limitations detailed below. TDM-GCC (the MinGW-w64 version) provides some hacks that you may find useful in your specific situation, although I recommend using vanilla GCC at all times for maximum compatibility.


GCC for Windows is provided by two projects currently. They both provide a very own implementation of the Windows SDK (headers and libraries) which is necessary because GCC does not work with Visual Studio files.

  1. The older mingw.org, which @Mat already pointed you to. They provide only a 32-bit compiler. See here for the downloads you need:

    • Binutils is the linker and resource compiler etc.
    • GCC is the compiler, and is split in core and language packages
    • GDB is the debugger.
    • runtime library is required only for mingw.org
    • You might need to download mingw32-make seperately.
    • For support, you can try (don't expect friendly replies) [email protected]

    Alternatively, download mingw-get and use that.

  2. The newer mingw-w64, which as the name predicts, also provides a 64-bit variant, and in the future hopefully some ARM support. I use it and built toolchains with their CRT. Personal and auto builds are found under "Toolchains targetting Win32/64" here. They also provide Linux to Windows cross-compilers. I suggest you try a personal build first, they are more complete. Try mine (rubenvb) for GCC 4.6 to 4.8, or use sezero's for GCC 4.4 and 4.5. Both of us provide 32-bit and 64-bit native toolchains. These packages include everything listed above. I currently recommend the "MinGW-Builds" builds, as these are currently sanctioned as "official builds", and come with an installer (see above).

    For support, send an email to [email protected] or post on the forum via sourceforge.net.

Both projects have their files listed on sourceforge, and all you have to do is either run the installer (in case of mingw.org) or download a suitable zipped package and extract it (in the case of mingw-w64).

There are a lot of "non-official" toolchain builders, one of the most popular is TDM-GCC. They may use patches that break binary compatibility with official/unpatched toolchains, so be careful using them. It's best to use the official releases.

Answer from rubenvb on Stack Overflow
Top answer
1 of 5
96

EDIT Since not so recently by now, MinGW-w64 has "absorbed" one of the toolchain building projects. The downloads can be found here. The installer should work, and allow you to pick a version that you need.

Note the Qt SDK comes with the same toolchain. So if you are developing in Qt and using the SDK, just use the toolchain it comes with.

Another alternative that has up to date toolchains comes from... harhar... a Microsoft developer, none other than STL (Stephan T. Lavavej, isn't that a spot-on name for the maintainer of MSVC++ Standard Library!). You can find it here. It includes Boost.

Another option which is highly useful if you care for prebuilt dependencies is MSYS2, which provides a Unix shell (a Cygwin fork modified to work better with Windows pathnames and such), also provides a GCC. It usually lags a bit behind, but that is compensated for by its good package management system and stability. They also provide a functional Clang with libc++ if you care for such thing.

I leave the below for reference, but I strongly suggest against using MinGW.org, due to limitations detailed below. TDM-GCC (the MinGW-w64 version) provides some hacks that you may find useful in your specific situation, although I recommend using vanilla GCC at all times for maximum compatibility.


GCC for Windows is provided by two projects currently. They both provide a very own implementation of the Windows SDK (headers and libraries) which is necessary because GCC does not work with Visual Studio files.

  1. The older mingw.org, which @Mat already pointed you to. They provide only a 32-bit compiler. See here for the downloads you need:

    • Binutils is the linker and resource compiler etc.
    • GCC is the compiler, and is split in core and language packages
    • GDB is the debugger.
    • runtime library is required only for mingw.org
    • You might need to download mingw32-make seperately.
    • For support, you can try (don't expect friendly replies) [email protected]

    Alternatively, download mingw-get and use that.

  2. The newer mingw-w64, which as the name predicts, also provides a 64-bit variant, and in the future hopefully some ARM support. I use it and built toolchains with their CRT. Personal and auto builds are found under "Toolchains targetting Win32/64" here. They also provide Linux to Windows cross-compilers. I suggest you try a personal build first, they are more complete. Try mine (rubenvb) for GCC 4.6 to 4.8, or use sezero's for GCC 4.4 and 4.5. Both of us provide 32-bit and 64-bit native toolchains. These packages include everything listed above. I currently recommend the "MinGW-Builds" builds, as these are currently sanctioned as "official builds", and come with an installer (see above).

    For support, send an email to [email protected] or post on the forum via sourceforge.net.

Both projects have their files listed on sourceforge, and all you have to do is either run the installer (in case of mingw.org) or download a suitable zipped package and extract it (in the case of mingw-w64).

There are a lot of "non-official" toolchain builders, one of the most popular is TDM-GCC. They may use patches that break binary compatibility with official/unpatched toolchains, so be careful using them. It's best to use the official releases.

2 of 5
26

Download mingw-get and simply issue:

mingw-get install gcc.

See the Getting Started page.

🌐
Quora
quora.com › How-do-you-install-GCC-on-Windows
How to install GCC on Windows - Quora
Step 1: Search MinGW C Compiler on the Web To download the MinGW compiler, go to your favorite browser and search MinGW C Compiler or click on the sourceforge.net link. Step 2: Download MinGW.
Discussions

How do I get a GCC?
On which OS? More on reddit.com
🌐 r/C_Programming
31
2
September 1, 2022
.net - How to install GCC for Go on Windows 10? - Stack Overflow
I want to use external library on Go programming language and i am using this command for instance : go get github.com/alecthomas/gozmq from command line, but it gives such an error: github.com/p... More on stackoverflow.com
🌐 stackoverflow.com
How to install GCC / MinGW on Windows ? (QT 5.1.1)? confused ! | Qt Forum
hi, i know how to install it on linux/ubuntu , i tried to install in on windows , but i can't do it , im confused ! can you tell me exact easy steps how to i... More on forum.qt.io
🌐 forum.qt.io
June 13, 2014
Why is installation so complicated?
Those are really the build instructions, and yes, building gcc is painful. If you were on Linux I'd just say install the gcc package and be done, but on Windows I don't know. Let's ask Google ... Um, actually, it looks like a bit of a joke (I just searched for "install gcc on windows"), I wouldn't fancy it either. However, if you do want to run gcc on Windows, have a look at MinGW . Or else, bite the bullet and put Linux on a VM and discover how to do software development! (I may be biased here.) More on reddit.com
🌐 r/gcc
10
11
April 3, 2017
🌐
Medium
sajidifti.medium.com › how-to-install-gcc-and-gdb-on-windows-using-msys2-tutorial-0fceb7e66454
How to Install GCC and GDB on Windows Using MSYS2 — Tutorial | by Sajid Anam Ifti | Medium
November 23, 2023 - For developers transitioning to or working in a Windows environment, setting up a robust toolchain for C and C++ programming is crucial. In this tutorial, I will guide you through the process of installing GCC (GNU Compiler Collection) and GDB (GNU Debugger) on Windows using MSYS2, a software distribution and building platform.
🌐
Visual Studio Code
code.visualstudio.com › docs › cpp › config-mingw
Using GCC with MinGW
November 3, 2021 - You can install the C/C++ extension by searching for 'C++' in the Extensions view (⇧⌘X (Windows, Linux Ctrl+Shift+X)). 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.
🌐
Instructables
instructables.com › design › software
Learn to Install GCC (Mingw-w64) Compiler Tools on Windows 10 Using MSYS2 : 9 Steps - Instructables
November 28, 2022 - Learn to Install GCC (Mingw-w64) Compiler Tools on Windows 10 Using MSYS2: We will learn How to install 64 bit (GCC) GNU Compiler Collection on a Windows 10 system using MSYS2 installer for C/C++ software development. After installing GCC, we will compile a Win32/64 GUI applica…
🌐
SourceForge
sourceforge.net › projects › gcc-win64
gcc-win64 download | SourceForge.net
Download gcc-win64 for free. x64 build of GCC for Windows. x64 C/C++ compiler for Windows using (unofficial build): - gmp - mpfr - mpc - isl - cloog - mingw-w64 - gcc - seh You need at least core2 command set support to run this application. Note that every version with bundled gdb needs at ...
Find elsewhere
🌐
DEV Community
dev.to › gamegods3 › how-to-install-gcc-in-windows-10-the-easier-way-422j
GCC for Windows: How to install gcc in Windows 10? (the easier way) - DEV Community
December 12, 2021 - ###### (This is assuming you didn't ... 10. Click on OK, and OK and close the other windows. Open a Command Prompt Terminal and try typing `gcc --version` and press Enter....
🌐
GNU
gcc.gnu.org › install › binaries.html
Installing GCC: Binaries - GNU Project
1 month ago - We are often asked about pre-compiled versions of GCC. While we cannot provide these for all platforms, below you’ll find links to binaries for various platforms where creating them by yourself is not easy due to various reasons. Please note that we did not create these binaries, nor do we support them. If you have any problems installing ...
🌐
GitHub
gist.github.com › alandsilva26 › 53cd2fecf253554c2f671766d3df5d66
Instructions for installing GCC Compiler on Windows · GitHub
Locate your program I will be giving this example considering .c program cd into your desired directory where file is locate or type cmd in the adress bar then type command gcc -o name name.c eg. gcc -o helloworld helloworld.c The name after ...
🌐
Stack Overflow
stackoverflow.com › questions › 50712718 › how-to-install-gcc-for-go-on-windows-10
.net - How to install GCC for Go on Windows 10? - Stack Overflow
If you need additional one as a compiler you need to specifically require it · https://cygwin.com/cygwin-ug-net/setup-net.html#setup-packages · In your case as go is unlikey a cygwin program, you can not use the cygwin compiler to extend your go language. You could try the mingw64 project ... Sign up to request clarification or add additional context in comments. ... If go could be compiled for Windows, it is likely to be easier in cygwin than in mingw.
🌐
Sololearn
sololearn.com › en › Discuss › 1465401 › how-do-i-install-gcc-compiler-on-windows-10-64-bit
How do I install GCC compiler on Windows 10 (64 bit)? | Sololearn: Learn to code for FREE!
August 21, 2018 - Its easy to install GCC on your windows machine. Just download TDM Gcc compiler here is a link to it. https://sourceforge.net/projects/tdm-gcc/ Once you install it you are good to go. Make your C program and save it as .C extension.
🌐
Qt Forum
forum.qt.io › home › qt development › general and desktop › how to install gcc / mingw on windows ? (qt 5.1.1)? confused !
How to install GCC / MinGW on Windows ? (QT 5.1.1)? confused ! | Qt Forum
June 13, 2014 - Version Mingw have a gcc compiler included in the package and you don't need anything else. The latest final version is 5.3.0. Version 5.4.0 is not even Alpha. There is also "Online installer":http://download.qt-project.org/official_releases/online_installers/qt-opensource-windows-x86-1.6.0-3-online.exe.
🌐
C++ Programming Language
cpp-lang.net › setup gcc on windows
Setup GCC on Windows | C++ Programming Language
On Windows, the GCC compiler is part of the MSYS2 package. You can download it from this page: ... The steps described below are also on their main page. Just click forward through their installer. ... Remember to install msys2 in the disk space, that have no special characters or spaces in the path, preferably:
🌐
PhoenixNAP
phoenixnap.com › home › kb › devops and development › how to install gcc on windows
How to Install GCC on Windows
September 23, 2024 - Install GCC on Windows using one of three methods: MinGW-w64, Chocolatey, or Windows Subsystem for Linux (WSL).
Top answer
1 of 3
11

USE MINGW-W64

  1. Install mingw-w64 (Follow the "Sourceforge" link) and install it to the default Program Files based path.

  2. Select the latest "version" (for GCC), change "architecture" from i686 (32-bit) to x86_64 (64-bit), and change "threads" to win32.

  3. Add the bin folder to the beginning of your Git BASH (MINGW64) path:

     $ export PATH="c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin:$PATH"
    

    You'll, of course, need to adjust the above path to match the version of your of your particular install:

     $ export PATH="c:/Program Files/mingw-w64/<YOUR_ARCH_VERSION_REVISION_FOLDER>/mingw64/bin:$PATH"
    

Alternatively

You may be able to just install it directly into the same folder as Git: C:\Program Files\Git.

But I haven't tried this alternative approach and I wouldn't recommend it because it is likely to cause issues when updating and may confuse uninstallers, leaving remnants. (if the two installations don't interfere to begin with)

[ Edit: GNU Make is installed as mingw32-make.exe. You can make a copy of it, somewhere in your $PATH which you have permission to, and rename it to make. Git Bash seems to respect that it's executable, even without an extension, which is handy if you don't want it picked up outside of the MinGW environment (even though it may be in your PATH). ]

2 of 3
2

You have to share Windows' PATH (and probably other) environment variables with MinGW. For MSYS2 you can share them by adding this to your Windows' env. variables:

MSYS2_PATH_TYPE=inherit

🌐
WinLibs
winlibs.com
WinLibs - GCC+MinGW-w64 compiler for Windows
Under Compiler's installation directory set the location of the mingw32 or mingw64 folder from the extracted download (you can also browse to it by clicking on the ... button) Click the tab Program Files set the following settings (taking into account 32-bit (i686) or for 64-bit (x86_64)) C compiler: i686-w64-mingw32-gcc.exe / x86_64-w64-mingw32-gcc.exe
🌐
mingw-w64
mingw-w64.org › downloads
Pre-built Toolchains - mingw-w64
Once they are installed, they should be used according to the general cross-compilation approach. Installation: through integrated package manager. ... Installation: through integrated package manager. GCC with the MCF thread model is a series of x86 and x64 native toolchains built by LH_Mouse.
🌐
bodHOST
bodhost.com › tutorial › how to install gcc compiler on windows
How to Install GCC Compiler on Windows
November 24, 2025 - Learn how to install the GCC compiler on Windows using MinGW or MSYS2. Follow the step-by-step guide to set up GCC.