3

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!

mindthief
  • 12,755
  • 14
  • 57
  • 61

2 Answers2

4

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.

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • 4
    One thing to keep in mind with MacPorts and OSX is that by default it compiles everything for X11 which is probably not what you want. I had to do this: sudo port install gtk2 +no_x11 +quartz +universal The +universal part was needed for Snow Leopard which is 64-bit by default. – jcoffland Jul 30 '10 at 21:28
3

I have solved same error using this export:

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

Maybe this can help someone...

wirrwarr
  • 265
  • 1
  • 14