[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Dummy question concerning libraries - repeation
From:       Stephan Kulow <coolo () kde ! org>
Date:       1999-03-03 16:31:30
[Download RAW message or body]

Hans Meine wrote:
> 
> Hi!
> 
> Since noone answered until now, I want to repeat my question:
> 
> I would like to know how libraries are given version numbers and how one links
> against a special version of a lib.
> I mean, how does a prog know it needs "xx.so.2" and not "xx.so.3" and how do I
> compile libraries to give "xx.so.3" instead of "xx.so.2"? If someone would
> point this out or give me a hint where to look at, that would be nice!
> (I hate this lowlevel-programming-stuff, but I guess I just _have_ to know it.
> ;-) )
> 
What for? 

To make it short: you can't. And the linker picks up the xx.so file and
in this
the output filename is hardcoded (for example into libqt.so libqt.so.2).
This
one in return is most often a symlink to another file with more
prefixes. 
You can give the linker the real file, so for example xx.so.3 if you
need to,
but just creating a symlink somewhere and giving him the -L argument is
the
better way. 

But note that if you rename a libqt.so.2 file to libqt.so.3, it will
still
open libqt.so.2 (ldd will tell you that). If you need more information
look
into libbfd in the binutils package.

Greetings, Stephan
P.S. These informations is only true for ELF afaik.

-- 
As long as Linux remains a religion of freeware fanatics,
Microsoft have nothing to worry about.  
                       By Michael Surkan, PC Week Online

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic