LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   2 different versions of glib and pkgconfig! (https://www.linuxquestions.org/questions/linux-software-2/2-different-versions-of-glib-and-pkgconfig-225006/)

karl0s 08-31-2004 07:16 PM

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. :p I don't ask much, do I?

Thanks for *any* help..


Karl.

GT_Onizuka 08-31-2004 07:18 PM

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 :D.

foo_bar_foo 08-31-2004 10:27 PM

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
2.2.3
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
-lglib-2.0

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 libglib-2.0.so -> libglib-2.0.so.0.200.3
lrwxrwxrwx 1 root root 22 Mar 30 18:10 libglib-2.0.so.0 -> libglib-2.0.so.0.200.3
-rwxr-xr-x 1 root root 599931 Mar 30 18:10 libglib-2.0.so.0.200.3

that is -- my glib-2.2.3 is called libglib-2.0.so.0.200.3
and there are two symbolic links that are called simply libglib-2.0.so and libglib-2.0.so.0
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

karl0s 09-01-2004 05:41 AM

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/libgobject-2.0.so.0: 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*. :o

Any further ideas?

karl0s 09-01-2004 06:05 AM

I lost my temper, and deleted libgobject-2.0.so.0...

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.... :confused:


All times are GMT -5. The time now is 06:17 AM.