Skip to content

Download GTK for Windows

stahta01 edited this page Apr 22, 2018 · 13 revisions

Note: These directions were based on Download for Windows

Note: These instructions are intended for developers wanting to develop applications based on GTK+, not for end-users.

Requirements

Windows version

GTK+ requires Windows Vista or later.

For older versions of Windows, you should do a custom build of older versions of GLib and GTK+. Installing GTK+ and its dependencies

The easiest way to install GTK+ and its dependencies in binary form is through the MSYS2 project. MSYS2 provides a UNIX-like development environment for Windows. It provides packages for many software applications and libraries, including the GTK+ stack. These packages are installed using the pacman package manager.

Note: in the following steps, we'll assume you're using a 64-bit Windows. Therefore, the package names include the x86_64 architecture identifier. If you're using a 32-bit Windows, please adapt the instructions below using the i686 architecture identifier.

Step 1: Install MSYS2

Download the MSYS2 installer that matches your platform and follow the installation instructions. Installer

Step 2: Install GTK+3 and its dependencies

Open a MSYS2 shell, and run:
pacman -S --needed mingw-w64-x86_64-gtk3

Step 3 (recommended): Install GTK+ core applications

Glade is a GUI designer for GTK+. It lets you design your GUI and export it in XML format. You can then import your GUI from your code using the GtkBuilder API. Read the GtkBuilder section in the GTK+ manual for more information.

To install Glade:
pacman -S --needed mingw-w64-x86_64-glade

Devhelp is a help browser. It lets you easily navigate offline in the GTK+, glib and gobject API help relative to the version of these libraries installed on your system.

To install Devhelp:
pacman -S --needed mingw-w64-x86_64-devhelp

Step 4 (optional): Install the Python bindings

If you want to develop a GTK+3 application in Python, you need to install the Python bindings.

If you develop in Python 3:
pacman -S --needed mingw-w64-x86_64-python3-gobject

If you develop in Python 2:
pacman -S --needed mingw-w64-x86_64-python2-gobject

Step 5 (optional): Install build tools

If you want to develop a GTK+3 application in other languages like C, C++, Fortran, etc, you'll need a compiler like gcc:
pacman -S --needed mingw-w64-x86_64-gcc

Distributing GTK+ with your application

You are welcome to redistribute GTK+ binaries, including applications that bundle them, on other web sites, CD-ROM, and other media. You don't have to ask for permission. That's one of the points of Free Software. One important thing that the GNU licenses require is that you must also redistribute the source code. This usually means at least the gettext, GLib, GTK+, Pango and Atk sources. List of GTK+ dependencies

GTK+ depends on several libraries:

  • GLib
  • cairo
  • Pango
  • ATK
  • gdk-pixbuf

To run GTK+ programs you will also need:

  • gettext-runtime
  • fontconfig
  • freetype
  • expat
  • libpng
  • zlib