Requirements

The gtk crate expects GTK+, GLib and Cairo development files to be installed on your system.

Debian and Ubuntu

> sudo apt-get install libgtk-3-dev

Fedora

> sudo dnf install gtk3-devel glib2-devel

### Fedora 21 and earlier
> sudo yum install gtk3-devel glib2-devel

OS X

> brew install gtk+3

Windows

Make sure you have the GNU ABI version of the rust compiler installed. Contrary to earlier instructions, you don’t need to uncheck “Linker and platform libraries” in the Rust setup or delete gcc.exe and ld.exe in Rust’s bin directory.

Getting the GTK+ SDK

The GTK+ Project recommends using the GTK+ SDK provided by MSYS2:

If you prefer getting the SDK from gtk-win64 or building it from source, set the variables in the next section accordingly.

Using the native Windows shell

Back in the cmd.exe shell set the GTK_LIB_DIR and PATH environment variables:

If you’re happy with these changes, make them permanent with SETX:

C:\> SETX GTK_LIB_DIR %GTK_LIB_DIR%
C:\> SETX PATH %PATH%

Using the MSYS2 MinGW shell

Instead of setting the environment variables manually, you can let pkg-config sort the paths out for you.

Possible problems

Error on linking on Windows MSYS2: undefined reference to `imp_acrt_iob_func’

Download these packages and install it with pacman -U <path>:

Also pkg-config better ignore these packages on updating, add “IgnorePkg = mingw-w64-x86_64-crt-git mingw-w64-x86_64-headers-git” to /etc/pacman.conf