'CLion Custom toolchain can't find MinGW from msys2

I recently installed the 64 bit MinGW toolchain from MSYS2 and have added it to my windows system PATH.

windows terminal g++ version check

However, when I try to add it to Clion, it says that it can't find it even though I have specified the correct path.

clion toolchain configuration

Does anyone know what went wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source