public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Question about linking multiple copies of the same library
@ 2004-12-31  8:38 Lourens Janse van Rensburg
  2004-12-31 15:32 ` Matthias David Siebler
  0 siblings, 1 reply; 4+ messages in thread
From: Lourens Janse van Rensburg @ 2004-12-31  8:38 UTC (permalink / raw)
  To: msiebler, gcc-help


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:

$ll
-rw-rw-rw-    1 vanrensb users        0 Dec 31 10:24 libX.so.2

$ln -s libx.so.2 libx.so.1

$ll
-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 ->
libx.so.2


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.

Lourens...


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Matthias David Siebler
Sent: 30 December 2004 01:19
To: gcc-help@gcc.gnu.org
Subject: Question about linking multiple copies of the same library



Hello:

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
libstdc++-libc6.1-2.so.3

My current application uses a newer compiler which requires
libstdc++-libc6.2-2.so.3

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?

Thanks



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Question about linking multiple copies of the same library
@ 2004-12-29 23:19 Matthias David Siebler
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias David Siebler @ 2004-12-29 23:19 UTC (permalink / raw)
  To: gcc-help



Hello:

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 libstdc++-libc6.1-2.so.3

My current application uses a newer compiler
which requires libstdc++-libc6.2-2.so.3

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?

Thanks



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-07 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-31  8:38 Question about linking multiple copies of the same library Lourens Janse van Rensburg
2004-12-31 15:32 ` Matthias David Siebler
2005-01-07 22:25   ` Craig Allen
  -- strict thread matches above, loose matches on Subject: below --
2004-12-29 23:19 Matthias David Siebler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).