Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing the latest version of mingw-w64 on Windows

Tags:

c++

mingw-w64

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?

like image 361
kayosa Avatar asked Apr 29 '20 08:04

kayosa


3 Answers

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.

like image 61
Brecht Sanders Avatar answered Oct 23 '22 04:10

Brecht Sanders


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.

like image 3
jacob Avatar answered Oct 23 '22 02:10

jacob


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}
like image 1
datenwolf Avatar answered Oct 23 '22 02:10

datenwolf