4

我根据需要安装了 GTK,brew install gtk+以便在我的 Mac 上从源代码编译 xchat。当我尝试安装它时,它说Cannot find GTK! Not building GTK FrontEnd. 我怀疑我应该在安装 gtk+ 后更新环境变量,但我不知道如何。

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

路径在上面的代码中列出。我尝试添加与它相关的所有类型的东西(例如/usr/local/Cellar/gtk+/2.24.20/bin/usr/local/Cellar),$LD_LIBRARY_PATH但它没有工作。有任何想法吗?

4

1 回答 1

2

我对 after 有类似的问题brew install gtk+。具体来说,我得到:

    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

在为我的应用程序运行时make,此命令解决了我的问题:

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

关于这个问题的扩展答案已经在这里得到了回答:https ://stackoverflow.com/a/23988317/4694621 。


这可能是一个问题,因为gtk+取决于这些库(source):

Glib
Pango
ATK
GDK
GdkPixbuf
Cairo
于 2015-06-08T08:53:01.950 回答