doplumi
doplumi

Reputation: 3118

GTK+ installed with brew is not found when I try to compile other applications

I installed GTK with brew install gtk+ as I need it to compile xchat from source on my Mac. When I try to install it tough, it says Cannot find GTK! Not building GTK FrontEnd. I suspect I should've updated the environment variables once installed gtk+ but I don't know how.

iMac:xchat-2.8.8 Domenico$ brew info gtk+
gtk+: stable 2.24.20
http://gtk.org/
/usr/local/Cellar/gtk+/2.24.20 (1184 files, 52M) * // here is the path!!!
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/gtk+.rb
==> Dependencies
Build: pkg-config, xz
Required: glib, jpeg, libtiff, gdk-pixbuf, pango, atk, cairo
Optional: jasper
==> Options
--with-jasper
    Build with jasper support

The path is listed in the code above. I tried adding all kind of things related to it (e.g. /usr/local/Cellar/gtk+/2.24.20/bin or /usr/local/Cellar) to $LD_LIBRARY_PATH but it didn't work. Any ideas?

Upvotes: 4

Views: 5937

Answers (1)

Mateusz Piotrowski
Mateusz Piotrowski

Reputation: 9127

I had smiliar issues with after brew install gtk+. Specifically, I got:

    Package xcb-shm was not found in the pkg-config search path.
    Perhaps you should add the directory containing `xcb-shm.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'xcb-shm', required by 'cairo', not found
    app.c:1:10: fatal error: 'gtk/gtk.h' file not found
    #include <gtk/gtk.h>
             ^
    1 error generated.
    make: *** [app] Error 1

while running make for my app and this command solved my problem:

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

The extended answer on this problem has been already answered here: https://stackoverflow.com/a/23988317/4694621.


This might be an issue since gtk+ depends on these libraries (source):

Glib
Pango
ATK
GDK
GdkPixbuf
Cairo

Upvotes: 2

Related Questions