Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install GTK3 and minGW on Windows using MSYS2

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.

like image 484
user3885884 Avatar asked Mar 26 '16 21:03

user3885884


People also ask

Does MSYS2 install MinGW?

MSYS2 provides up-to-date native builds for GCC, mingw-w64, CPython, CMake, Meson, OpenSSL, FFmpeg, Rust, Ruby, just to name a few. To provide easy installation of packages and a way to keep them updated it features a package management system called Pacman, which should be familiar to Arch Linux users.

Can I use GTK in Windows?

Applications built using Gtk# will run on many platforms including Linux, Windows and macOS. The Mono packages for Windows include GTK, Gtk# and a native theme to make applications look like native Windows applications.


1 Answers

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.

like image 123
David Grayson Avatar answered Nov 14 '22 23:11

David Grayson