pacman -S mingw-w64-ucrt-x86_64-gsl and from then on the GSL library will be automatically found by your compiler! Make sure any compilers and libraries you install have this package prefix: mingw-w64-ucrt-x86_64-. Only use unprefixed packages for misc command-line utilities (such as grep, sed, make, etc), unless you know what you're doing.