[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: General question about libs

Hans wrote: 
> Hi Folks, 
> I would like to rebuild or repack an old application, which needs a library, 
> which is no more used in debian. Due to this orphaned lib, this package can no 
> more installed.
> The lib, which is responsible is "libqt3-mt".  I believe, there might be a 
> successor for this special lib.
> For my understanding: 
> 1. If there is a successor for a special lib, does it then contain all 
> routines of the older lib? Exactly: Can a lib just exchanged againts a newer 
> one?

Not necessarily. This is sometimes true, especially when the
versions are very close together. 3.09 is likely to be very
similar to 3.10, but not very much like 5.1.

> 2. If I want to rebuild the binary just because of the newer lib, can this 
> just be done, by exchanging the entry of the old lib against a newer one?

Sometimes, but not always. For example, if the new library changed all calls
from DrawRectangle to DrawPolygon(rectangle), it won't work.

> 3. If I do not want to rebuild the sources, just repack the  package, so that 
> its dependencies fits again in debians repo, will it work, when just 
> exchanging the lib in the "control" file in the package?


A program exists in two forms: source code, which humans can
read and write, and machine code, which is executed by the
computer. (I am oversimplifying this for the sake of brevity.)

To take in source code and produce machine code can be done in
one of two ways:

- an interpreted language reads the source code at the time you
  run the program -- really, you are running the interpreter and
  feeding it the source code files -- and produces machine code
  that it also runs at that time.

- a compiled language reads the source code when the compiler
  is run, and produces machine code in a new file which can be
  run without the compiler.

An interpreted library is a set of useful bits of code that are
called in by the interpreter when it is directed to do so by the
source code. "Please read this library and let me use the
DrawRectangle function." The source code needs to specify
exactly what library it wants to use, so changing out the
library will require at least a small change to update that.

A compiled library is a set of useful bits of code that are
called in by the compiler when it is directed to do by the
source code -- and it is incorporated into the eventual binary
directly (static linking) or a reference to the right bytes 
in an external file is included into the binary (dynamic


Reply to: