MSYS2 - Install gcc or toolchain?

sancho.s ReinstateMonicaCellio picture sancho.s ReinstateMonicaCellio · Aug 7, 2018 · Viewed 16k times · Source

I am using Portable MSYS2 + MinGW64. I mean to get gcc.

Some sources indicate installing gcc, e.g.

$ pacman -Sy mingw-w64-i686-gcc
$ pacman -Sy mingw-w64-x86_64-gcc

http://www.cplusplus.com/forum/windows/227005/

Others (mostly in github) indicate installing a toolchain, e.g.

$ pacman -Sy mingw-w64-x86_64-toolchain

https://github.com/tpaviot/oce/issues/631

https://github.com/Alexpux/MSYS2-packages/issues/293

https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2

What are the reasons, if any, for preferring one or the other?

Answer

ssbssa picture ssbssa · Aug 7, 2018

Found on the mailing list:

Then you can install toolchain by typing:
pacman -S mingw-w64-i686-toolchain
or
pacman -S mingw-w64-x86_64-toolchain
It installs full MinGW-w64 GCC with prerequisites. If you don't need full
GCC then you can install only needed languages. Variants are:
32bit:
mingw-w64-i686-gcc  - C/C++
mingw-w64-i686-ada
mingw-w64-i686-fortran
mingw-w64-i686-objc  - ObjC/ObjC++

64bit:
mingw-w64-x86_64-gcc  - C/C++
mingw-w64-x86_64-ada
mingw-w64-x86_64-fortran
mingw-w64-x86_64-objc  - ObjC/ObjC++

So the toolchain installs all available languages, not just gcc.