Using a specific version of a dynamic library - how?
From: Thomas Aho (my_spam_at_bluewin.ch)
Date: 8 May 2004 08:03:47 -0700
Is there a way to link my application in a way, which makes it select
a certain version of a dynamic library at run-time?
Say for example that I write an application and use qt 3.1.2. I want
able to install the binary on a server from where everyone in my
can run it. A precondition is then of course that they have the
or qt-mt.so.3.1 somewhere in their LD_LIBRARY_PATH.
The problem is that if there is also a newer version of qt installed
system, /usr/lib/qt-mt.so will be linked to for example
starting my application, it will load the 3.2.2 version of qt-mt,
What I simply would like to do is to link my application in a way
it "look for 3.1.2; if there is no 3.1.2, look for 3.1; if there is no
3.1, look for 3, ...".
The only possiblity I currently have is to give a directory to the
linker, and it will look in that directory first for libs (e.g.
/usr/lib/qt-3.1.2/lib). That however requires that all users have qt
3.1.2 installed in that directory, which is a bit lot to require from
someone who is not developing qt applications. I would rather just
like to copy qt-mt.so.3.1.2 to /usr/lib.
Is it possible to do what I want?