Dynamic Link Library (DLL)
A Dynamic Link Library (DLL) is a computer file that contains a collection of data and coded instructions, allowing multiple programs to access shared resources to perform specific tasks. Primarily used in Microsoft Windows environments, DLLs enhance efficiency by only loading into memory when required, thereby optimizing the use of system resources. Unlike static libraries, which are directly tied to executable files (.exe), DLLs remain separate and can be utilized by various applications simultaneously.
Typically, DLL files have a .dll extension, although they may also adopt other extensions like .ocx for ActiveX controls, .cpl for control panel items, and .drv for device drivers. This flexibility allows for a streamlined approach to software development, enabling updates to shared libraries without the need to alter each individual program. While DLLs are essential for smooth operation and functionality in Windows, they can also be a source of common computer errors, especially if dependencies between DLLs are disrupted or if a DLL is accidentally deleted. In such cases, users may need to restart their systems or reinstall affected applications to resolve issues.
On this Page
Dynamic Link Library (DLL)
A dynamic-link library (DLL) is a computer file that contains a library of data and coded instructions that other programs can access to perform specific tasks. DLL files are used with Microsoft Windows operating systems and applications. These files contain information that can be accessed by multiple programs, often simultaneously. A dynamic-link library, as opposed to a static library, is only opened when a program needs to retrieve data. This results in a more efficient use of computer resources such as memory and hard drive space. Typically, a computer's DLL files end with a .dll extension; however, in some cases, other file name extensions may be used.
Background
In computer technology, an operating system (OS) is the software that allows a computer to function at a fundamental level. An OS communicates with the computer hardware—the physical elements of the machine such as the monitor, keyboard, hard drive, and storage disks—allocating memory, processing tasks, and accessing information. In the early 1980s, Bill Gates and Paul Allen, founders of the software company Microsoft, were hired by International Business Machines Corporation (IBM) to produce an operating system for the company's new personal computer (PC). The system they created was called MS-DOS, short for Microsoft Disk Operating System. While MS-DOS was licensed to IBM, Microsoft retained the rights to the software, allowing it to become the standard operating system used in most PCs and transforming the company into a multibillion-dollar software giant.
In 1985, Microsoft released its own OS, a more user-friendly system called Windows. Windows used a program known as a graphical user interface (GUI), which allowed users to operate the computer by interacting with graphic icons and symbols rather than typing in commands. Basic operating system tasks were performed by MS-DOS; however, higher level operations such as the GUI utilized programs from a dynamic-link library. For example, the graphics device interface—a set of programs that enable the computer to translate fonts, color palettes, and other graphical elements for use by the monitor and printer—were stored in a DLL called gdi.exe. The extension .exe denotes an executable file, a designation that instructs the operating system to run the program when opened. With improvements in technology, successive operating systems added considerably more programs and computing capability. Future systems, including Windows 10 released in 2014, continued to rely on collections of DLLs as a cornerstone of their designs.
Overview
A computer library file is a package of data and code that acts as a storehouse for use by other programs. There are two types of library files: static libraries and dynamic libraries. A static library is a collection of routines or functions tied directly to the .exe file. As long as the program is open and running, it is tapped into the static library and takes up memory. A dynamic library separates the .exe file and the information contained in the library itself. The information remains on the library "shelf" and is only used when a program needs to access it. The data does not take up any memory until it is called upon and releases it back when it is no longer needed. Most DLLs are installed with the Windows operating system, while others can be added with future downloads. Because programs automatically load the DLL files, users do not have to open or edit them directly. Doing so may cause problems with the programs or other DLLs that need to access it. DLL files can also be used by more than one program at the same time.
Text fonts, for example, that may be used by a word processing program and a graphics program are stored in one DLL. If a user opens a program such as Microsoft Word, the program accesses the fonts in the DLL. A user who wishes to install a new group of fonts would only have to download an update for the DLL, and leave the Word program untouched. This method saves time and computer storage space, as libraries do not have to be duplicated for each executable program. While DLL files are separate from .exe files, they sometimes end with an .exe extension. DLL files normally use a .dll extension, but they can also end in .ocx, .cpl, .drv, and others depending on their function.
This can be illustrated by some of the more common programs that come with a Windows operating system. ActiveX controls are programs that allow the computer's browser and desktop applications to be linked to the World Wide Web. Examples of these functions would be selecting a date from the calendar at the bottom taskbar or using Adobe Flash Player, a multimedia program used to view web content. ActiveX control files are DLLs labeled with the extension .ocx, for OLE (object linking and embedding) control extension. Control panel, or .cpl files, allow users to customize and edit the basic system settings for Windows. Each of the elements found in the control panel, from selecting a screen saver, changing fonts, and setting a new default home page, has its own DLL file. Device drivers are files that allow the computer to communicate with additional hardware devices, such as printers. Driver DLL files are labeled with the .drv extension.
Because so many programs rely on DLLs to function properly, they are often the source of common computer errors. Sometimes one DLL is dependent on another to be able to function. This may cause a problem if one DLL receives an upgrade, while the other does not. The problem may be able to be fixed by restarting the computer and allowing the DLLs to be uploaded properly. If the DLL file was accidentally deleted, it may be able to be retrieved from the recycle bin, or the original program may have to be reloaded. In some cases, the entire operating system may need to be restored.
Bibliography
"A.1—Static and Dynamic Libraries," LearnCpp.com, 21 Sept. 2023, www.learncpp.com/cpp-tutorial/a1-static-and-dynamic-libraries/. Accessed 13 Jan. 2025.
"Common Computer Terms." PC.net, pc.net/glossary/. Accessed 13 Jan. 2025.
Fisher, Tim. "What Is a DLL File?" Lifewire, 24 Oct. 2021, www.lifewire.com/what-is-a-dll-file-2625852. Accessed 13 Jan. 2025.
"Overview of Dynamic Libraries." Apple Inc., developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/OverviewOfDynamicLibraries.html. Accessed 13 Jan. 2025.
Smiley, John. Learn to Program with Visual Basic, 2014 Edition. Smiley Publishing, 2014.
Ward, Kieth. "A Brief History of Microsoft Windows." Lifewire, 9 Feb. 2023, www.lifewire.com/brief-history-of-microsoft-windows-3507078. Accessed 13 Jan. 2025.
"What Is a DLL?" Microsoft, support.microsoft.com/en-us/kb/815065. Accessed 13 Jan. 2025.