Search code examples
mingwmsys2pacman-package-manager

Why can I install MingW packages in MSYS2 if I can't use them?


I don't understand the point behind this. I have an MSYS2 installation. I use pacman -Ss to search for packages. There's mingw32/, mingw64/, and msys/ packages for each thing. Apparently I want the msys packages, because that's what I'm running, right?

I can install msys/gcc this way. That works fine. I can do a which gcc now and find it in /usr/bin/gcc and I can use it. Lovely.

Now I want to install and use clang instead. Clang apparently doesn't have a msys package. It only has mingw64/mingw-w64-x86_64-clang and mingw32/mingw-w64-i686-clang. Does that mean I can't use them? I installed the former package, and which clang (and its variants) finds nothing. I search online and everything I find says this is the way to use clang on MSYS2, but it clearly isn't because nothing working. Why can we install packages that we can't use?? What am I missing here?!


Solution

  • MSYS2 is a software distribution that provides three different environments. You select the environment you want to use by clicking on the appropriate shortcut when you launch the MSYS2 terminal/shell. You can also look in the main directory of your MSYS2 installation, where you will find msys2.exe, mingw32.exe, and mingw64.exe, which each correspond to a different environment.

    The point of the two MinGW environments provded by MSYS2 is to build and/or use native Windows software. The point of the msys2 environment is to build programs from the Linux world that need good POSIX support, and those programs will depend on msys-2.0.dll.