Hi! Can anyone explain me what the difference is between (for example) /usr/X11R6/lib/libXm.so and /usr/X11R6/lib/libXm.so.2 Met vriendelijke groet, Harry ten Berge Test Engineer Holland Institute of Traffic Technology HITT B.V. P.O. box 717 Apeldoorn email :berge@hitt.nl <http://www.hitt.nl> tel : +31 555432537 fax : +31 555432554
On Mon, Mar 25, 2002 at 04:30:02PM +0100, berge@hitt.nl wrote:
Hi!
Can anyone explain me what the difference is between (for example)
/usr/X11R6/lib/libXm.so and /usr/X11R6/lib/libXm.so.2
AFAIK... .2 is a specific version number of the library. If a program just wants to link against any version of libXm, it will reference libXm, but if it specifically wants version 2, it will use libXm.2. You will probably find that /usr/X11R6/lib/libXm.so is a link to a specific version, probably /usr/X11R6/lib/libXm.so.2. HTH.... -- David Smith Work Email: Dave.Smith@st.com STMicroelectronics Home Email: David.Smith@ds-electronics.co.uk Bristol, England
Can anyone explain me what the difference is between (for example)
/usr/X11R6/lib/libXm.so
and
/usr/X11R6/lib/libXm.so.2
The name! :o) Actually I'm kind of serious - if you look carefully you'll see that the one without a version number is actually a link to the one with. When a program wants some of the functionality a library provides, it "links that library in", so it can access the code inside it. Some programs just don't care which version of a library they use (because, eg., they only use basic features) so they'll ask for "libXm.so". Other programs might insist on version 2, so they'll ask for "libXm.so.2". Others might need a really up to date version, so they'll ask for eg. "libXm.so.2.1", and complain if they can't get it. If you only have one version of the library on the machine (which is the normal case) you make a bunch of soft links such that whichever version a programs asks for, it'll always be presented with your one, single library. -- 3:44pm up 20 days, 1:12, 2 users, load average: 0.14, 0.03, 0.01
On Mon, 25 Mar 2002 15:51:29 +0000, you wrote:
Some programs just don't care which version of a library they use (because, eg., they only use basic features) so they'll ask for "libXm.so". Other programs might insist on version 2, so they'll ask for "libXm.so.2". Others might need a really up to date version, so they'll ask for eg. "libXm.so.2.1", and complain if they can't get it.
Close, but not quite a cigar ;-) Usually a library has a full version: lib<name>.so.<major version>.<minor version>.<patchlevel> libraries also usually have internal name, the so called soname, which gets assigned at the time the library is linked. As normally libraries with the same major version are compatible, the soname is normally lib<name>.so.<major version> Part of the job of ldconfig is reading these sonames and creating symbolic links from this soname to the real library. Now if you link a program this library, this soname will get recorded in the program. If this program is run, the dynamic linker will search for a file with this name (it will actually look into the cache created by ldconfig). The lib<name>.so is usually only a symbolic link to the actual library and is solely used for linking. If you request a specific library via the -l<name> switch, the linker (ld) will first search for lib<name>.so and then for lib<name>.a (that is, if you didn't pass -static, which would make it search for lib<name>.a only). Philipp
On Wednesday 27 March 2002 07:20 pm, Philipp Thomas wrote:
Close, but not quite a cigar ;-) Usually a library has a full version:
lib<name>.so.<major version>.<minor version>.<patchlevel>
libraries also usually have internal name, the so called soname, which gets assigned at the time the library is linked. As normally libraries with the same major version are compatible, the soname is normally
lib<name>.so.<major version>
Part of the job of ldconfig is reading these sonames and creating symbolic links from this soname to the real library.
Now if you link a program this library, this soname will get recorded in the program. If this program is run, the dynamic linker will search for a file with this name (it will actually look into the cache created by ldconfig).
The lib<name>.so is usually only a symbolic link to the actual library and is solely used for linking. If you request a specific library via the -l<name> switch, the linker (ld) will first search for lib<name>.so and then for lib<name>.a (that is, if you didn't pass -static, which would make it search for lib<name>.a only).
I had been wondering about all this stuff and recently discovered that it's pretty well described in the Program Library HOWTO. Paul Abrahams
participants (5)
-
Berge, Harry ten
-
Dave Smith
-
Derek Fountain
-
Paul W. Abrahams
-
Philipp Thomas