User forums > General (but related to Code::Blocks)

How to install and use MSYS


Hello, this is my first post here.

I am trying to install the GSL in my Windows machine, so that Code::Blocks can find and use it.

I am reading these previous threads:

-,14965.msg100146.html#msg100146 ,

among others.

I downloaded the GSL from and unzipped the file.

But the point in which I get stuck is how to build the GSL from the downloaded files.

More precisely, I don't know:

1. How to use MinGW to 'install' or build the GSL.

2. Where in my hard drive should I install it.

About question 1, I've read that I should use MSYS, which is something that comes installed with MinGW. Well, I haven't found it. I am using (or trying to) the version of MinGW that is installed together with Code::Blocks using the installation programme ending with `mingw-setup.exe` from

So, the final version of question 1 is: Where is MSYS within the installation of MinGW? Or should I download it separately? From where? How do I install it? How do I use it to build the GSL?

What windows Operating System? Include bit size?  32 or 64

Edit: If Windows 10 or later and 64 bit; I would use MSys2.

Then install the already built GSL library.

Tim S.

MSYS2 is different to MinGW32/64 that is included in some of the C::B 20.03 installers, but they both use the GCC compiler (I am trying to KISS for the newbies). I find the MSYS2 environment has allot more packages and is easier to install the packages than the MinGW32/64 environment.

To install MSYS2 you need to download the installer from the following page:

Then you need to install other packages using the pacman package manager. You can search for MSYTS2 packages on the page.

The following is part of a batch file I use to install my MSYS2 x64 environment after running the installer from the page. The command are run within the C:\msys64\msys2.exe shell:

--- Code: ---pacman -Syu

@rem GCC TOOLCHAIN <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake msys2-runtime-devel

@rem SDL2 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_mixer  mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-freetype mingw-w64-x86_64-zziplib mingw-w64-x86_64-libpng

@rem UTILS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
pacman -S mingw-w64-x86_64-libzip zip unzip mingw-w64-x86_64-diffutils

@rem pacman -S mingw-w64-x86_64-cmake -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-glade
@rem pacman -S python mingw-w64-x86_64-python mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-pandas mingw-w64-x86_64-python-xlrd

@rem QT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
pacman -S mingw-w64-x86_64-qt-creator mingw-w64-x86_64-qt5 mingw-w64-x86_64-qt5-static mingw-w64-x86_64-qt-installer-framework

@rem UPDATE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@rem update packages or "pacman -Syuu" for bad database or QT missing entry in dll.
pacman -Syu

--- End code ---

GSL package exists for MSYS2. To install it you can run the following command:

--- Code: ---pacman -S  mingw-w64-gsl
--- End code ---

There are other MSYS2 GSL packages.

If after installing MSYS2 C::B cannot find the compiler you will need to:
1. Change the directory in the "settings->compiler" menu then the "toolchain executables"  tab settings to C:\MSYS64 (assuming you are using x64 and have not changed the default directory).
2. Change the program files to remove the "mingw32-" prefix.
3. Setup the debugger in the "settings->debugger"
4. Link the debugger to the compiler via the debugger option in the "settings->compiler" menu then the "toolchain executables" tab

If the above is too hard or complex give my unofficial C::B installer a go, info on it and links are in the following post:,24592.0.html

Thank you!!

I managed to install MSYS2, and then to install GSL using `pacman -S  mingw-w64-gsl`.  :)


[0] Message Index

Go to full version