Question about linking multiple copies of the same library
Lourens Janse van Rensburg
Fri Dec 31 08:38:00 GMT 2004
What I usually do is to make a symbolic link that has the name of the
desired (older) version of the .so, and make it point to the current
(newer) version of the .so
e.g. if I have a program that requires an older version of library x,
say libx.so.1, while I have on my system only a newer version, say
libx.so.2, I do the following:
-rw-rw-rw- 1 vanrensb users 0 Dec 31 10:24 libX.so.2
$ln -s libx.so.2 libx.so.1
-rw-rw-rw- 1 vanrensb users 0 Dec 31 10:24 libx.so.2
lrwxrwxrwx 1 vanrensb users 9 Dec 31 10:26 libx.so.1 ->
This usually works because the libraries are backwards compatible, i.e.
they add new stuff in the later versions but they don't remove the
existing functions inside the library.
* Your old program should run OK because the symlink makes it think that
it is linking to the older version of the .so.
* Your new programs should automatically link to the current (newer)
version of the .so because your compiler/linker is aware of the correct
library version that it needs.
Hope this helps.
From: firstname.lastname@example.org [mailto:email@example.com] On
Behalf Of Matthias David Siebler
Sent: 30 December 2004 01:19
Subject: Question about linking multiple copies of the same library
i have a question about how to link multiple copies of the same library.
I have a existing application with needs to include a thirdparty
library. (For this library source is not
available) This is a dynamically linked library that requires
My current application uses a newer compiler which requires
Is it possible to link the application such that the IBM library links
to the old libstdc++ and everything else resolves to the new library?
How can this be done?
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the Gcc-help