Search code examples
windowsmingwmsys2

msys2 doesn't find mingw64


I downloaded:

https://mingw-w64.org/doku.php/download/mingw-builds

https://mingw-w64.org/doku.php/download/msys2

and installed them under C:/development/msys64. Under this folder I find the msys2.exe and the mingw64 folder, which in turn contains the bin one with all the mingw executable.

I added C:/development/msys64/mingw64/bin folder to the PATH env var. In fact from a Windows prompt I can invoke the gcc - for example. Instead inside the msys2 shell I cannot find them. I mean, they are in /mingw64/bin but they are not available at prompt.

I'm sure I missed some steps!


Solution

  • MSYS2 has packages for its own GCC toolchains and you would probably be better off using those toolchains instead of downloading a different one. For example, to use a 64-bit MinGW GCC, you would have to run pacman -S x86_64-w64-mingw32-toolchain and then make sure you are starting MSYS2 using the "MinGW-w64 64-bit Shell" shortcut (or something like that) so that /mingw64/bin is on your PATH.

    Also, MSYS2 does not respect your system or user environment variables; it uses its own PATH by default.