开发者

Problems compiling libjingle/gtk+-2.0 for Mac OS X

I'm trying to compile libjingle on Mac OSX Snow Leopard. The INSTALL file said to './configure', 'make' and 'make install', as usual. But make fails for me. Initially it gave some messages indicating that I didn't have pkg-config installed (I guess OSX doesn't come with it installed?), so I downloaded pkg-config from http://pkgconfig.freedesktop.org/releases/

Now I get this message:

Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+开发者_如何学运维-2.0' found

I tried to install gtk by using the script at SourceForge: http://sourceforge.net/projects/gtk-osx/

(this is the website pointed to by the gtk website)

Running the script didn't really seem to do anything, here is the output:

$./gtk-osx-build-setup.sh
Checking out jhbuild (2.27.3) from git...
From git://git.gnome.org/jhbuild
 * tag               2.27.3     -> FETCH_HEAD
Installing jhbuild...
Installing jhbuild configuration...
Installing gtk-osx moduleset files...
Done.
$

And I still get that error message about "Package gtk+-2.0 not found" while make-ing libjingle. Help will be appreciated, thanks!


EDIT

I've since come to the conclusion that MacPorts isn't the best way to install GTK anymore; the official OSX port of GTK is better. What your original problem probably was is that you weren't compiling your program from within the jhbuild environment; use

jhbuild shell

to start up an environment.

Original answer

The best way to compile GTK programs on OS X is to install MacPorts and then use that to install GTK by typing:

sudo port install gtk2

in a Terminal. Install any other packages you end up needing in the same fashion. When all that's done, set your path as follows:

export PATH=/opt/local:$PATH

and you should be able to compile your program.


I have solved same error using this export:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

Maybe this can help someone...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜