are you using MSYS2?
if yes, open MSYS2 UCRT64 if run under 64 systems and install this:
pacman -S mingw-w64-x86_64-toolchain