|
18.2.4 Dependent Libraries
On modern Unices(42), the shared library architecture
is smart enough to encode all of the other libraries that a dynamic
module depends on as part of the format of the file which is that
module. On these architectures, when you
Less well endowed systems(43), cannot do this by themselves. Since Libtool release 1.4,
libltdl uses the record of inter-library dependencies in the
libtool pseudo-library (see section 10. Introducing GNU Libtool) to manually
load dependent libraries as part of the An example of the sort of difficulties that can arise from trying to load a module that has a complex library dependency chain is typified by a problem I encountered with GNU Guile a few years ago: Earlier releases of the libXt Athena widget wrapper library for GNU Guile failed to load on my a.out based GNU/Linux system. When I tried to load the module into a running Guile interpreter, it couldn't resolve any of the symbols that referred to libXt. I soon discovered that the libraries that the module depended upon were not loaded by virtue of loading the module itself. I needed to build the interpreter itself with libXt and rely on back-linking to resolve the `Xt' references when I loaded the module. This pretty much defeated the whole point of having the wrapper library as a module. Had Libtool been around in those days, it would have been able to load libXt as part of the process of loading the module.
If you program with the X window system, you will know that the list of
libraries you need to link into your applications soon grows to be very
large. Worse, if you want to load an X extension module into a non-X
aware application, you will encounter the problems I found with Guile,
unless you link your module with
Or, if you are using Automake:
It is especially important to be aware of this if you develop on a modern platform which correctly handles these dependencies natively (as in the example above), since the code may still work on your machine even if you don't correctly note all of the dependencies. It will only break if someone tries to use it on a machine that needs Libtool's help for it to work, thus reducing the portability of your project. |