encyclopegia.org

Shared library

A shared library is a library of executable code that is loaded in memory such that multiple executables (programs and other libraries) can use it at runtime. In contrast, a static library is copied into an executable. A static library can be re-used (a form of sharing) in multiple executables, but each executable contains a copy of the library code instead of sharing a copy in memory with other executables. Although not true today, historically, all libraries were static. Although a shared library can have static linkage, such a library is not classified as a static library. Often, a shared library is also a dynamic library loaded by a dynamic linker, which generally makes use of the library easier for the programmer than if it instead it had static linkage. A dynamic library need not be accessible to multiple executables (shared library) and a shared library need not be loaded at consumer runtime (dynamic library).

A shared library is a library of executable code that is loaded in memory such that multiple executables (programs and other libraries) can use it at runtime. In contrast, a static library is copied into an executable. A static library can be re-used (a form of sharing) in multiple executables, but each executable contains a copy of the library code instead of sharing a copy in memory with other executables. Although not true today, historically, all libraries were static. Although a shared library can have static linkage, such a library is not classified as a static library. Often, a shared library is also a dynamic library loaded by a dynamic linker, which generally makes use of the library easier for the programmer than if it instead it had static linkage. A dynamic library need not be accessible to multiple executables (shared library) and a shared library need not be loaded at consumer runtime (dynamic library). ==Memory sharing== Library code may be shared in memory by multiple processes and on disk. If virtual memory is used, processes would execute the same physical page of RAM mapped into the processes' different address spaces. This has advantages. For instance, on the OpenStep system, applications were often only a few hundred kilobytes in size and loaded quickly; most of their code was located in libraries already loaded for other purposes by the operating system. Programs can accomplish RAM sharing by using position-independent code, as in Unix, which leads to a complex but flexible architecture, or by using common virtual addresses, as in Windows and OS/2. These systems ensure that code has a high probability of being shared by various means, like pre-mapping the address space and reserving slots for each shared library. A third alternative is a single-level store with a single address space, as used by the IBM System/38 and its successors. This allows position-dependent code, with programs and libraries assigned a permanent address in that address space. In some cases, different versions of shared libraries can cause problems, especially when libraries of different versions have the same file name and various applications are installed on a system, each requiring a specific version. This scenario is known as DLL hell, named after the Windows and OS/2 DLL files. Most modern operating systems after 2001 have clean-up methods to eliminate such situations or use application-specific "private" libraries. ==See also== ==References== ==Sources== ==External links== How To Write Shared Libraries by Ulrich Drepper

References

No reference rows published for this article.

Cite this article

MLA

"Shared library." encyclopegia.org, 2026, https://encyclopegia.org/wiki/shared-library. Accessed 24 November 2026.

Chicago

"Shared library." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/shared-library.

APA

encyclopegia.org. (2026). Shared library. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/shared-library

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Amateur telescope making

enwiki · references available

Secrecy

enwiki · references available

Sakhalin

enwiki · references available

ITV (TV network)

enwiki · references available

Yeso

enwiki · references available

La Pérouse Strait

enwiki · references available

Magadan

enwiki · references available

Curtly Ambrose

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1340800357 · 0.5 · snapshot enwiki-001340800357

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.