GTK Problem

TheSource

Senior member
Nov 20, 2003
541
0
0
I'm going through dependecy hell right now trying to install a program from source. I got a few sorted out but now I'm stuck on gtk+. It keeps spitting this out at me in terminal.

checking for GLIB - version >= 2.4.0...
*** 'pkg-config --modversion glib-2.0' returned 2.9.5, but GLIB (2.8.3)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
no
configure: error:
*** GLIB 2.4.0 or better is required. The latest version of
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Why not use your distro's package management system?

What version of glib do you have installed? It looks like you have multiple versions...
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
ya that is what it looks like.

You should use packages provided by your distro. But I have no idea what distro your using... Normally you can't compile against what is installed by default, but *-dev packages are made aviable with headers and such so that you can compile against the items that come with your system by default.
 

TheSource

Senior member
Nov 20, 2003
541
0
0
why not install the the package manager? i did but the version in thier is older than what i need. im using ubuntu. and the package that depends on gtk isn't in there.
 

SleepWalkerX

Platinum Member
Jun 29, 2004
2,649
0
0
When you downloaded GTK+ from here make sure to go the dependencies link, but also it seems you didn't download everything in the download link for gtk. Glib is in there. So click on source and download that stuff too.

Last time I remember GTK+ was a pain to install from source packages. From taking a look at their dependencies link, it looks like it doesn't have all of them. I remember I needed fontconfig, and then needed freetype and the list went on. Easiest way to do it is from a package manager. Since you have Ubuntu, did you edit your apt sources? Adding more repositories should give you more access.

Oh and why do you want to compile gtk in the first place? Your system should already have a compiled version. Are you trying to compile a program from source or something?
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: TheSource
why not install the the package manager? i did but the version in thier is older than what i need. im using ubuntu. and the package that depends on gtk isn't in there.
Fair enough, but as others have pointed out you almost certainly don't want to be compiling glib and gtk themselves. Just compile whatever app it is you want. And in order to do that you'll need the *-dev (e.g. glib-dev) packages - those contain the headers and other things you'll need to compile programs that depend on that library. From the looks of things, you already had one version of glib on your system (2.8.3 probably) and then installed a new one (2.9.5) by hand. This is a mess, because you've now confused pkg-config, the program that tries to keep track of library versions on your system. I'm guessing that you tried compiling the app, and got some kind of "glib not found" message. But that just means you were lacking the glib-dev package, not that the library wasn't there at all.

Depending on how far you've gotten and what options you chose, things could be more or less difficult to fix at this point. Hopefully, everything you hand-compiled will have installed to /usr/local, so that it can easily be identified and removed. Then get the *-dev packages you need to compile your app.

 

TheSource

Senior member
Nov 20, 2003
541
0
0
Im trying to install a media player. i get this error . how can i tell if, any, of these are installed?

checking for glib-2.0 >= 2.6.0 gtk+-2.0 >= 2.6.0 gthread-2.0 pango... configure: error: Cannot find glib2/gtk2/pango
root@ubuntu:/home/user/audacious-0.2#
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: TheSource
how can i tell if, any, of these are installed?

checking for glib-2.0 >= 2.6.0 gtk+-2.0 >= 2.6.0 gthread-2.0 pango... configure: error: Cannot find glib2/gtk2/pango
root@ubuntu:/home/user/audacious-0.2#
If this is a semi-recent Ubuntu distribution, then you have them - those libraries are required for a ton of graphical applications, and should be part of the default install. Again, what you need are the dev packages.

If you want to check your installed version numbers, here's one way:

dpkg -l | grep glib2

...or use your favorite graphical package manager.

 

drag

Elite Member
Jul 4, 2002
8,708
0
0
apt-cache search glib|grep dev

That's the sort of thing I do to find development packages so I can compile against existing libraries.


Also take a look at wajig. Install that and the packages it recommends to have installed.
apt-get install wajig

Then it should recommend you to install stuff like deborphan and fakeroot and items like that.

If your application you want is aviable in a newer version of ubuntu or in the experimental versions of ubuntu then you can edit your /etc/apt/sources.list file and add on the deb-src lines for the experimental version or newer version of ubuntu.

The development version of Ubuntu is 'dapper' I beleive. Just add the deb-src lines for that.

Then you can go:
wajig update
wajig build-depend packagename
wajig build packagename
dkpg --install packagename-versionstuff.deb

If it has unresolved dependancies you may have to run apt-get -f install to resolve them for you. Then install the deb package you built.

And if that works then you can easily have a packaged version of the program you need, but with a newer version, and it's easy to uninstall it or upgrade it again later. Also it avoids having to install a bunch of packages from a newer version of Ubuntu if you don't want to risk breaking a bunch of stuff.


edit:
I do this often with Debian stable so that I can do things like have a newer version of OpenAFS or backport yaird so that I can build a initrd on kernels that don't support devfs.