1

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?!

Tustin2121
  • 2,058
  • 2
  • 25
  • 38

1 Answers1

3

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.

David Grayson
  • 84,103
  • 24
  • 152
  • 189
  • So then MSYS2 is not actually just a better version of MinGW, like it touts itself to be on its own download page? Its actual purpose is different than MinGW? – Tustin2121 Sep 26 '19 at 01:55
  • I don't follow your logic at all. MSYS2 is great. You're just running the wrong environment. If you want to have an environment for compiling MinGW programs, run MSYS2's mingw32.exe or mingw64.exe. I'm not sure how well the clang package works these days, but GCC works great, and you install it by running `pacman -S $MINGW_PACKAGE_PREFIX-toolchain`. – David Grayson Sep 26 '19 at 02:08
  • If something touts itself as a better version of something, I'd want to use the better version. I want to use MSYS2, but you're literally telling me I can't because they're not the same thing even though it's advertised as a better rewrite of the other... You're telling me I have to use the mingw command line instead of the msys2 command line... I don't understand what you don't understand. – Tustin2121 Sep 26 '19 at 04:19
  • mingw32.exe is part of MSYS2, so when you run it you are using MSYS2. – David Grayson Sep 26 '19 at 17:08
  • 1
    On which site does it say it's a better version of MinGW? – ssbssa Sep 30 '19 at 10:33