Installing the latest version of mingw-w64 on Windows

14,639

Solution 1

GCC 10 is officially released. The personal build for Windows (MinGW-w64) that can be downloaded from https://winlibs.com requires no installation, just extract to a folder.

Solution 2

Building GCC on Windows from source code is very difficult and cannot be recommended to beginners. Moreover, GCC 10 has not yet been officially released and you may need to wait a few more weeks to get it.

If you want an up-to-date GCC in Windows (currently version 9.3), I recommend downloading and installing the MSYS2 package. Once you install it, launch it using the "MinGW64" icon and install the correct compiler in the terminal. For details, see this question: How to install MinGW-w64 and MSYS2?

Once you have done this, you can forget about MSYS2 and simply use the directory with the binaries in your PATH.

The maintainers of MSYS2 are very keen in supporting bleeding edge software, so once GCC 10 is released, you will be able to update to it (using the command pacman -Syu) very soon.

Solution 3

I recommend obtaining MinGW through MSys2 https://www.msys2.org/

First install MSys2, then perform a full update by first updating the package database and updating pacman

pacman -SySu

After the update is done it will ask you to close the terminal without exiting to shell. Do so, then perform a full update by running

pacman -Su

after which you can install the mingw-w64 packages. Use

pacman -Ss mingw

to list all available packages. Install with

pacman -S ${PACKAGE_NAME}

Solution 4

Installing via MSYS2 will give you gcc 10.1 .

You can treat MSYS2 as a package manager for keeping gcc up to date, and not use its shell if you like. Its packages include standalone 32-bit gcc, standalone 64-bit gcc, and MSYS2-target gcc. It is a very similar process to installing gcc via package manager on a Linux system.


how something as basic as installation can be this confusing

This is not uncommon with open source when there's no customer income stream to pay developers to build and maintain a smooth installer. Someone has to do the work of hosting and maintaining binary builds and often people will do it for a while out of the goodness of their heart, and then move on, as seems to have happened with the "official" mingw-builds installer.

So while the solutions you see on this thread today will work for now, in a few years' time the answers may be different

Share:
14,639
Admin
Author by

Admin

Updated on June 23, 2022

Comments

  • Admin
    Admin almost 2 years

    I am desperately trying to install the latest version of mingw-w64 to get acess to gcc 10 on windows 10.

    I used the online installer for mingw-w64 in the past, but it is still stuck in 2018 on 8.1.0 and seems to be abandoned.

    So i tried installing it manually.

    On SourceForge or the GitHub Mirror you seem to only get a chunk of code without any clear instructions on what do do, how to build and install it. The only installation instructions that i managed to find required you to already have a working gcc installed (very helpful if that is what you want to get installed in the first place).

    On their website and wiki there is a precompiled binary package mentioned. But the only one that i could find was horribly outdated as well.

    Comparing this with the installation process of clang or the microsoft build tools, it actually blows my mind how something as basic as installation can be this confusing.

    Maybe it's just me missing the obvious , but how do you actually install this thing?

  • Abel
    Abel over 3 years
    thanks! extract and run ftw. deploy an ssl cert and that might just become the most popular way to get mingw for offline deploy.
  • Brecht Sanders
    Brecht Sanders over 3 years
    @Abel what do you mean exactly with "deploy an ssl cert"?
  • Abel
    Abel over 3 years
    your website uses http and not https.
  • Brecht Sanders
    Brecht Sanders over 3 years
    @Abel Thanks for your remark. I will work on that.
  • ThePirate42
    ThePirate42 about 3 years
    I would like to donate to the project in bitcoin, do you have an address? I'm asking here because on your site there is no contact information.
  • Karsten Pedersen
    Karsten Pedersen almost 3 years
    I would like to add my thanks for your builds. The msys2 build of mingw-w64 gdb drags in python and a heap of other crud (true Linux package style!)