public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Lourens Janse van Rensburg" <Lourens.jansevanRensburg@intec.co.za>
To: <msiebler@alum.mit.edu>, <gcc-help@gcc.gnu.org>
Subject: RE: Question about linking multiple copies of the same library
Date: Fri, 31 Dec 2004 08:38:00 -0000	[thread overview]
Message-ID: <9F6C06DD358A58458921D913A8C8BF7ACA9471@itszaex01.intec.co.za> (raw)


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 

             reply	other threads:[~2004-12-31  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-31  8:38 Lourens Janse van Rensburg [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9F6C06DD358A58458921D913A8C8BF7ACA9471@itszaex01.intec.co.za \
    --to=lourens.jansevanrensburg@intec.co.za \
    --cc=gcc-help@gcc.gnu.org \
    --cc=msiebler@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).