Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-31-2004, 07:16 PM   #1
LQ Newbie
Registered: Oct 2003
Distribution: Debian
Posts: 12

Rep: Reputation: 0
2 different versions of glib and pkgconfig!

I'm at my wit's end, and after several days of googling and playing around with it, I've finally decided to just ask, because I just can't work it out.

I have two versions of glib installed. 2.2.3, and 2.4.0. I just installed version 2.4.0 to install gtk.

I try to install gtk, and it tells me that pkg-config has found 2.4.0 using modversion, which is fine, but it tells me that it's found 2.2.3!!! I can't find 2.2.3, and all the references to glib I can find on the system are all 2.4.0 as far as I can tell. Now I've tried to change PKG_CONFIG_PATH and LIBRARY_PATH variables to the library /usr/local/lib, and I ran ldconfig. Now this has solved the problem for the time being, but what happens when a configure file needs something in /usr/lib? I can't keep switching when they both have dependancies, and I don't want programs to fail because of it. More importantly, I can't remove the old one because it has so many dependancies, even though I can't find it!

Any tips on how to remove this bugger would be *extremely* appreciated.

From my final goal, I want one version of glib, one version of gtk, and a working system with no conflictions. I don't ask much, do I?

Thanks for *any* help..

Old 08-31-2004, 07:18 PM   #2
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 31
I'm pretty sure you will find your answer here. I have the same problem and I was going to try tonight to get everything updated, I'll tell you how it went for me .
Old 08-31-2004, 10:27 PM   #3
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
hi, this post is unbearably long -- sorry -- kind of an involved issue
i would go about this kind of slowly from where you are
you have three issues to deal with
1) the pkg-config file
2) the library itself
3) the include headers

the problem is glib2 simply calls itself libglib-2.0
no matter what version you actually have
so the .pc package config file is called
glib-2.0.pc no matter what version

so if i go to /usr/lib/pkgconfig
and type
pkg-config --modversion glib-2.0
i get
in response

so you really don't want more than one version of glib-2.0.pc file on your PKG_CONFIG_PATH
if you have more than one because you installed the newer version in a different place i would rename the old one to OLDglib-2.0.pc or something

ok when i type
pkg-config --libs glib-2.0
i get

and there is the real rub
programs i link to my glib-2.2.3 think they are linking to libglib-2.0
and this is also coming out of pkg-config without any -L or library path flags
so off my linker goes looking for glib-2.0

in /usr/lib i have
lrwxrwxrwx 1 root root 22 Mar 30 18:10 ->
lrwxrwxrwx 1 root root 22 Mar 30 18:10 ->
-rwxr-xr-x 1 root root 599931 Mar 30 18:10

that is -- my glib-2.2.3 is called
and there are two symbolic links that are called simply and
pointing to it

if you installed the new glib in a different place than the old one, /usr/local instead of /usr
that is -- you didn't overwrite the old glib-2.0.pc or the symbolic links to the older library
just delete or rename (backup) the links to the old library and you are now using the new one

now the problem is if your already installed programs don't run correctly at run time on the new glib
then you have to choose to fix the links back pointing to the old library or recompile programs with the new one

and the last problem is the header files and these have to match the version you are tring to compile against (for run time these don't matter at all)
first type
pkg-config --cflags glib-2.0
i get
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
in /usr/lib/glib-2.0/include is just glibconfig.h
the rest are in /usr/include/glib-2.0

now if you have these header files now in multiple places like /usr and /usr/local or somewhere else
no problem cause the glib-2.0.pc file is pointing to the proper ones and just leave the others in case you want to switch the .pc file back to the older version.......

if you have overwritten either the .pc file or the includes with a new version overtop of the old ones
if you want to roll back to the old version delete the includes and reinstall the old package should fix it
otherwise just manipulate the .pc file by remaning and change the links to the lib
Old 09-01-2004, 05:41 AM   #4
LQ Newbie
Registered: Oct 2003
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
OK that was post of the day!

I configured pango with no worries after I found libglib files in /opt/gnome and removed them. I then checked the cflags, the pc file, and the modversion. All of them pointed toward the right version.

But when I ran make, I got another problem when it decided to access another shared library.

Writing a pango.modules file to use when running tests before installing Pango.
/home/karl/pango-1.4.1/pango/.libs/lt-pango-querymodules: error while loading shared libraries: /opt/gnome/lib/ undefined symbol: g_bsearch_array_new

That's the affected error when I run it. I never saw this one coming, and I have *no* idea how to fix *that*.

Any further ideas?
Old 09-01-2004, 06:05 AM   #5
LQ Newbie
Registered: Oct 2003
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
I lost my temper, and deleted

And it installs now. lol

Next problem and hopefully the final hurdle is with GTK itself. When configuring it, I get:

Pango 1.2.0 and Xft backend is required for x11 target.

I have 1.4.1 installed, and pkg-config confirms this. There are no other versions of pango on the system as far as I can tell.

Not sure what to do now....


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
conflicting glib versions and glib-config scius Linux - Software 5 06-03-2008 02:35 AM
Help!!! Can't install glib 2.4.7, because the configure script can't find pkgconfig RJARRRPCGP Linux - Newbie 3 11-22-2004 12:20 AM
Help!!! Can't install glib, because configure can't find pkgconfig RJARRRPCGP Linux - Newbie 1 11-20-2004 09:43 PM
trouble installing gtk, on glib pkgconfig returned 2.4.2 but 2.2.3 was found uv1 Linux - Newbie 7 08-02-2004 09:42 AM
Two versions of Glib? OnlyMe Linux - Software 1 04-21-2004 06:13 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:18 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration