Advantages of Dynamic Linking
Dynamic-link libraries serve much the same purpose that standard libraries
do, but they also have the following advantages:
- Applications link more quickly. With dynamic
linking, the executable code for a dynamic-link function is not copied into
the .EXE file of the application. Instead, only an import definition is
copied.
- Applications require less disk space. With
dynamic linking, several different program applications can access the same
dynamic-link function stored in one place. Without dynamic linking, the
code for the function would be repeated in every .EXE file.
- Libraries and applications are independent. Dynamic-link
libraries can be updated any number of times without relinking the applications
that use them. If you are a user of third-party libraries, this is particularly
convenient. You receive the updated .DLL file from the third-party developers,
and you only need to copy the new library onto your disk. At run time,
your applications automatically call the updated library functions.
- Code and data segments can be shared. Code
and data segments loaded from a dynamic-link library can be shared. Without
dynamic linking, such sharing is not possible because each file has its
own copy of all the code and data it uses. By sharing segments with dynamic
linking, you can use memory more efficiently.
[Back: What Is a Dynamic-Link Library?]
[Next: Linking without an Import Library]