Sun Studio 12: Fortran Programming Guide

4.1 Understanding Libraries

A software library is usually a set of subprograms that have been previously compiled and organized into a single binary library file. Each member of the set is called a library element or module. The linker searches the library files, loading object modules referenced by the user program while building the executable binary program. See ld(1) and the Solaris Linker and Libraries Guide for details.

There are two basic kinds of software libraries:

Typical system libraries that have both static (.a) and dynamic (.so) versions are:

There are two advantages to the use of libraries:

Library files provide an easy way for programs to share commonly used subroutines. You need only name the library when linking the program, and those library modules that resolve references in the program are linked and merged into the executable file.