Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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).
# 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.
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.
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
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.
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.
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.
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).
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.