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:
Static library. A library in which modules are bound into the executable file before execution. Static libraries are commonly named libname.a. The .a suffix refers to archive.
Dynamic library. A library in which modules can be bound into the executable program at runtime. Dynamic libraries are commonly named libname.so. The .so suffix refers to shared object.
Typical system libraries that have both static (.a) and dynamic (.so) versions are:
Fortran 95 libraries: libfsu, libfui, libfai, libfai2, libfsumai, libfprodai, libfminlai, libfmaxlai, libminvai, libmaxvai, libifai, libf77compat
C libraries: libc
There are two advantages to the use of libraries:
There is no need to have source code for the library routines that a program calls.
Only the needed modules are loaded.
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.