Shared Libraries
The name of a static libraries file is like libname.a
, while
a shared libraries file is named libname.so.x.y.z
, where:
x
is the major version number. It is incremented whenever the interface to the library changes.y
is the minor version number.z
is the optional release number.
This is the "real name" of a library file, the name of the file which contains it. In addition, a library has a "soname", the real name with only the major version number, which is a symbolic link to the real name. It may also have a "linker name", without any version number, a symbolic link to a "soname".
ldconfig
- Configure dynamic linker run-time bindings.
ldconfig
creates the necessary symbolic links and cache
(/etc/ld.so.cache
) for use by the run-time linker,
ld.so
) to the most recent shared libraries
found in the directories specified on the command line, in the file
/etc/ld.so.conf
, and in the trusted directories
/usr/lib
and /lib
.
Libraries listed in /etc/ld.so.preload
will take precedence
over the standard set.
This process can be overriden with the environment variable
LD_LIBRARY_PATH
: a colon-separated set of directories
where libraries should be searched for first,
before the standard set of directories.
ldd
- Print shared library dependencies.
- Shared Libraries. Program Library HOWTO - http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
- (Runtime) Dynamically Loaded Libraries. Program Library HOWTO - http://tldp.org/HOWTO/Program-Library-HOWTO/dl-libraries.html