How to install GTK3 and minGW on Windows using MSYS2

user3885884 picture user3885884 · Mar 26, 2016 · Viewed 11k times · Source

I am a big fan of C and I just finished reading "C Programming Langauge 2nd Edition". I must admit it was a great book and I learned a lot of stuff. But the thing is, until now I was just making console apps, so I want to move on and create some GUI applications. I searched Google and I found that the best library for making GUI apps in C is GTK. The problem is when I went to the GTK official website I couldn't find any binary package that I can install on Windows, instead they just mentioned that the preferred way to obtain GTK+ and its dependencies in binary form for Windows is to use the MSYS2 project. And that's it. No details and nothing about the necessary packages.

So can you guys suggest a way on how to install GTK+ on Windows or at least the list of necessary packages and dependencies? Thank you in advance.

Answer

David Grayson picture David Grayson · Mar 26, 2016

Follow the instructions here for installing MSYS2 and updating its packages:

http://msys2.github.io/

Then make sure to start MSYS2 using the "MSYS2 MinGW 32-bit" shortcut in your start menu (or mingw32.exe), which is the environment for compiling native 32-bit Windows programs.

Then install the toolchain, development tools, and GTK3:

pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-i686-gtk3 

Then I guess you could get started making a Makefile or a CMake project that uses GTK. MSYS2 gives you an environment very similar to Linux so you can use the tools and tutorials from Linux.