LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2005, 02:34 AM   #1
jhartney
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.0
Posts: 26

Rep: Reputation: 15
Glib problems


I've tried installing a few tarballs in the past week or so, and many require glib >= 1.2.0. I have 1.2.10 installed. What's the deal?
 
Old 01-07-2005, 02:58 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Assuming you installed glib-1.2.10 from a tarball...

Libraries need one more step to install than regular programs. You need to run ldconfig as root. That will scan all the libraries you have installed and place them in a cache.

You can also run ldconfig -v and manually scan the output to make sure glib is listed (ldconfig -v | grep libglib). If you don't see it, then there are a few possibilities:

1. The library is installed in a non-standard place (e.g. somewhere other than /lib, /usr/lib, /usr/local/lib, etc ). You will need to open the /etc/ld.so.conf file, and add the directory you installed it to. For instance, if you installed it to /opt/libs/glib, add that directory to ld.so.conf, and run ldconfig again.

2. When you compiled and installed the library, shared libraries were not enabled. A shared library ends in .so and possibly followed by a version (e.g. libglib.so.1.2). If there are no libglib.so* files, then shared libraries were not installed, and you'll need to consult the installation directions on how to build/enable them.

3. glib is not properly installed. Re-trace your steps, and make sure not to ignore any warnings or erros displayed (primarily during the make install step).
 
Old 01-07-2005, 03:40 AM   #3
jhartney
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.0
Posts: 26

Original Poster
Rep: Reputation: 15
Here's what I got:

# ldconfig -v | grep libglib
ldconfig: Can't stat /usr/X11R6/lib/Xaw95: No such file or directory
ldconfig: Can't stat /usr/X11R6/lib/Xaw3d: No such file or directory
ldconfig: Can't stat /usr/i486-linux/lib: No such file or directory
ldconfig: Can't stat /usr/i486-linux-libc5/lib: No such file or directory
ldconfig: Can't stat /usr/i486-linux-libc6/lib: No such file or directory
ldconfig: Can't stat /usr/i486-linuxaout/lib: No such file or directory
ldconfig: Can't stat /usr/i386-suse-linux/lib: No such file or directory
ldconfig: Can't stat /usr/openwin/lib: No such file or directory
ldconfig: Can't stat /opt/kde/lib: No such file or directory
ldconfig: Can't stat /opt/kde2/lib: No such file or directory
ldconfig: Can't stat /opt/gnome2/lib: No such file or directory
libglib-1.2.so.0 -> libglib.so
libglib-1.2.so.0 -> libglib.so
libglib-2.0.so.0 -> libglib-2.0.so.0.200.3


So, it looks like something is installed. I'm very new with Linux, thanks for the patience.
 
Old 01-07-2005, 03:42 AM   #4
trancelf
LQ Newbie
 
Registered: Jan 2005
Location: Topeka Kansas
Distribution: Fedora Core
Posts: 6

Rep: Reputation: 0
thanks from another poster

Thank you Dark Helmet for clarifying a problem I was having with upgrading glib. I was able to get the package to configure, compile, make etc. I installed it into /opt/glib2 and was having problems wtih other programs finding it so I pathed out the ld.so.conf file and added a PKG_CONFIG_PATH and LD_LIBRARY_PATH for compiling. I don't know, I may be able to remove the path statements I put in .bashrc. But basically I was looking for verification on how to make sure library paths are found and your help solved a question I've had for quite some time.

-marc
 
Old 01-07-2005, 03:58 AM   #5
trancelf
LQ Newbie
 
Registered: Jan 2005
Location: Topeka Kansas
Distribution: Fedora Core
Posts: 6

Rep: Reputation: 0
But I found a problem :)

smile, I found a problem.

Ok, here's a short summary of what I'm doing on my SuSE 9.1 professional. I wanted to just upgrade glib 1.2 to 2.6. It was installed as an RPM and I uninstalled it with the rpm -e --nodeps so the old glib is gone. The new glib apparently compiled correctly and was placed into /opt/glib2 (nonstandard directory). I added the path /opt/glib2/lib to ld.so.conf and ran ./ldconfig and ./SuSEconfig from /sbin. Here's the grep output of ldconfig:

linux:/sbin # ./ldconfig -v | grep libglib
./ldconfig: Can't stat /usr/X11R6/lib/Xaw95: No such file or directory
./ldconfig: Can't stat /usr/X11R6/lib/Xaw3d: No such file or directory
./ldconfig: Can't stat /usr/i486-linux/lib: No such file or directory
./ldconfig: Can't stat /usr/i486-linux-libc5/lib: No such file or directory
./ldconfig: Can't stat /usr/i486-linux-libc6/lib: No such file or directory
./ldconfig: Can't stat /usr/i486-linuxaout/lib: No such file or directory
./ldconfig: Can't stat /usr/i386-suse-linux/lib: No such file or directory
./ldconfig: Can't stat /usr/openwin/lib: No such file or directory
./ldconfig: Can't stat /opt/kde/lib: No such file or directory
./ldconfig: Can't stat /opt/kde2/lib: No such file or directory
./ldconfig: Can't stat /opt/gnome2/lib: No such file or directory
libglib-2.0.so.0 -> libglib-2.0.so.0.200.3
libglib-2.0.so.0 -> libglib-2.0.so.0.600.0
./ldconfig: Cannot stat /usr/lib/libopenh323.so: No such file or directory
./ldconfig: Cannot stat /usr/lib/libpt.so: No such file or directory

It appears that the files are registered? If this is the case something is still a little off....the old programs are looking for the 1.2 version and I need to know what step to take next to make sure the system can find the new files and use the new files. For example, I can't run my little ymessenger program or here's an error output for mozilla 1.7.5:

./mozilla-bin: error while loading shared libraries: libgmodule-1.2.so.0: cannot open shared object file: No such file or directory

Thank you.

-marc
 
Old 01-07-2005, 04:12 AM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Ah, that is something else I forgot to mention: the PKG_CONFIG_PATH variable. Libraries will typically install a <library name/version>.pc file in .../lib/pkgconfig. That file contains compiler flags so that programs can access the library. Again, if the library is installed in a non-standard location, PKG_CONFIG_PATH will need to be updated. I'll look into the specifics of how the pkg-config program runs (i.e. any config files that can be modified).

trancelf: I've got some bad news for you. glib 2 and glib 1 are distinctly different libraries. The developers broke compatability when the migrated to glib 2. There are a couple of other libraries like that (imlib comes to mind). You can have both versions installed if you need them though. So, you'll need to reinstall glib 1 to get mozilla going again. And you'll also need to keep glib 2 around if you've compiled anything that needs it.
 
Old 01-07-2005, 04:24 AM   #7
trancelf
LQ Newbie
 
Registered: Jan 2005
Location: Topeka Kansas
Distribution: Fedora Core
Posts: 6

Rep: Reputation: 0
all problems solved and system OK!

Thanks Dark Helmet,

I should have known that the glib1 and glib2 were seperate. I'm still used to thinking windows updates all the time. I was a desktop tech for 4 years and have been messing with linux on and off since Redhat in '96, but it's only been this past year when I got rid of MS alltogether.

Just wanted to say I will apt the glib1 back and now I know a little bit about grep and ldconfig to and pathing statements to stay out of trouble...i'll check each project more closely in the future to make sure I don't remove something I need.

-marc
 
Old 01-07-2005, 04:45 AM   #8
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Alright, doing a little poking at the pkg-config source, there doesn't seem to be a hidden config file (sometimes the man page forgets to mention them). So, according to the man page, the default path pkg-config checks is the library path pkg-config was installed to; meaning that the PKG_CONFIG_PATH needs to account for every other library path, and as a sanity check, might as well include the default as well.

In my /etc/profile, I have:
Code:
export PKG_CONFIG_PATH=/opt/lib:/usr/local/lib:/usr/lib:/lib
That will overwrite anything in PKG_CONFIG_PATH. If you'd like to be 100% safe, you could do this instead:
Code:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/lib:/usr/local/lib:/usr/lib:/lib
NOTE: You'll need to modify that command to include any special lib directories specific to your setup.

Then execute source /etc/profile (the change will be automatic next time you log in), and then echo $PKG_CONFIG_PATH to verify the changes. If it doesn't spit out what you expect, then there's a command in /etc/profile (or a file it includes) that overwrites the variable.

Now that ldconfig reports glib is in its cache and pkg-config knows about the directory glib is in, you should be able to compile things at will. If not, then there will need to be some further debugging (it might be a problem with the configure script of the software you're trying to install).

trancelf: One other command you may find useful: ldd. If you run ldd and give an executable filename as an argument, it will tell you which libraries it is linked to. However, it will only report dynamic/shared libraries. Any static libraries the executable linked against won't be reported (since they were built into the executable itself). It's not extremely useful unless you are installing libraries manually and then applications that use those libraries, but it will tell you what library (and version) is necessary should a program suddenly stop working (after doing some library tweaking/upgrading).
 
Old 01-07-2005, 04:59 AM   #9
jhartney
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.0
Posts: 26

Original Poster
Rep: Reputation: 15
soooooo uhhh.....i have no idea what you guys are talking about. Any ideas on my glib install?
 
Old 01-07-2005, 05:02 AM   #10
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
What directory did you install glib in and what does echo $PKG_CONFIG_PATH produce?
 
Old 01-07-2005, 05:12 AM   #11
jhartney
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.0
Posts: 26

Original Poster
Rep: Reputation: 15
It came standard on my SuSE 9.0 install (I just installed a few days ago). And, since i'm so new at this, I have no idea how to find out.

jhartney@linux:~> echo $PKG_CONFIG_PATH
/opt/gnome/lib/pkgconfig

I hope that's what you wanted.
 
Old 01-07-2005, 05:22 AM   #12
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Ah, ok. You didn't instal glib from source.

Do me a favor and execute (as root) updatedb ; locate glib.h. If you don't get an entry similar to: .../include/glib-1.2/glib.h, then you don't have the "development" version of glib installed (or whatever SUSE refers to them as). Whevever you try to compile software from source, you need to have the corresponding development package installed. I don't use SUSE myself, but I would bet a large sum of money that the glib 1 development is located on your install CDs somewhere.

If the locate command above does give you output, what is it?
 
Old 01-07-2005, 05:28 AM   #13
jhartney
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.0
Posts: 26

Original Poster
Rep: Reputation: 15
Here's what I got:

linux:~ # updatedb ; locate glib.h
bash: updatedb: command not found
bash: locate: command not found

I'll see what I can do about installing the devel software.
 
Old 01-07-2005, 05:34 AM   #14
jhartney
LQ Newbie
 
Registered: Dec 2004
Distribution: SuSE 9.0
Posts: 26

Original Poster
Rep: Reputation: 15
OK...so SuSE says I had glib2, glib2-devel, glibc, glibc-devel, glibc-locale and glib-devel installed. I just installed glib3-doc, gnet and gnet-devel
 
Old 01-07-2005, 05:35 AM   #15
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Um, that wasn't expected at all. I really don't know why those commands weren't found. They should be a part of every distribution. Maybe a path problem. Regardless, this command will do the same thing, but it will take a loooong time to finish:
find / -name "glib.h"

It may take a few minutes for it to finish, but it will work.
 
  


Reply


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
glib-2.0 problems. Sjonnie48 Mandriva 5 11-26-2005 01:34 AM
glib problems njjk DamnSmallLinux 2 04-22-2005 04:18 PM
glib problems migu Mandriva 3 02-26-2005 06:02 PM
[GLIB] Problems Installing GLIB ThA_eLMo_GoD Linux - Newbie 2 09-04-2004 06:27 PM
Problems relating to glib 1.2.10 and glib 1.2.9 p3ngu!n Mandriva 10 05-23-2004 10:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:05 AM.

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