LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Library Hell? Why not?? (https://www.linuxquestions.org/questions/linux-software-2/library-hell-why-not-133760/)

graffitici 01-11-2004 03:01 PM

Library Hell? Why not??
 
Hi,

This is one is more of a theoretical question. Now that I am on my way of becoming a more advanced linux user, I think I gotta have a deeper understanding of the internal machinery of the os. An issue that has been bugging for a long time is about the libraries. I am coming from a windows background, and there everything is done with DLLs. The counterpart of these under linux is AFAIK the libraries, found under /lib. However there are only some fixed number of them. Does every program install its own libraries under /lib? If not, where do they install them?

Also, in windows, when many programs use the same dll but with different version, the disparate versions clash. I am aware that this doesn't happen under linux. But why not? Can't two different apps install their libraries under /lib? Are all these libraries backward compatible?

Despite the wide availability of beginner documentations, I think the linux community lacks advanced information. I have made an exhaustive search about libraries on google, on the Linux Wiki for no avail. If you know such documentation, I would like to have it.

Thanks for your attention,
bibby

phobox 01-11-2004 03:37 PM

AFAIK, when you run ./configure, it checks what version of libraries you have and if you don't have the right version it errors out, and you have to figure out what to do about it. This applies to compiling apps from source, obviously.

In other words, the libraries don't come with the apps you install, they have standard versions that apps have to conform to.

graffitici 01-11-2004 03:53 PM

But what if your program needs to create his own libraries for the simple sake of abstraction? Just to make functions available in external files so that the future versions may use them, similar to the dlls in windows.
Does it still installs the libraries under /lib??

lyle_s 01-12-2004 06:57 PM

Re: Library Hell? Why not??
 
Just the minimum libaries needed to boot and administer the machine are in /lib. Look in /usr/lib to see most of the libraries. Depending on your distribution, you might have /opt/kde/lib and/or /opt/gnome/lib as well. Unless you specify otherwise, libraries compiled with the "./configure && make && make install" sequence wind up in /usr/local/lib.

Regarding library versioning, I think the major reason the Linux approach is considered better than the Windows approach is the library version is part of the filename in Linux. Start reading the gcc-HOWTO here: http://tldp.org/HOWTO/GCC-HOWTO/x575.html for some insight on this.

In reality, libraries on Linux aren't perfect either. I upgraded a library and it caused a program to stop working. It was because the programmer of the library changed the interface of the library without incrementing the version properly. If libraries were versioned as described here: http://sources.redhat.com/autobook/a...tobook_91.html and ldconfig was tweaked to understand this method more deeply, libraries would be perfect on Linux.

Maybe this will help,
Lyle


All times are GMT -5. The time now is 10:59 PM.