Author Topic: How to install and use MSYS  (Read 2428 times)

Offline vicent

  • Single posting newcomer
  • *
  • Posts: 8
  • Compiling and running
    • VGB's webpage
How to install and use MSYS
« on: November 30, 2021, 09:35:23 pm »
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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7197
    • My Best Post
Re: How to install and use MSYS
« Reply #1 on: November 30, 2021, 10:00:03 pm »
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.
« Last Edit: November 30, 2021, 10:02:27 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
When in doubt, read the CB WiKi FAQ.

Offline AndrewCot

  • Regular
  • ***
  • Posts: 341
Re: How to install and use MSYS
« Reply #2 on: December 01, 2021, 01:54:19 am »
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:
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

GSL package exists for MSYS2. To install it you can run the following command:
pacman -S  mingw-w64-gsl

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

Offline vicent

  • Single posting newcomer
  • *
  • Posts: 8
  • Compiling and running
    • VGB's webpage
Re: How to install and use MSYS
« Reply #3 on: December 03, 2021, 08:49:07 pm »
Thank you!!

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