Loading and Unloading Dynamic Shared Library

From Software Engineers Wiki
Jump to: navigation, search

How to load and unload libraries dynamically such as DLL and shared library?

Answer

Windows has DLL (Dynamic Link Libraries) which can be loaded and unloaded dynamically. Windows provides several APIs for this purpose.

  • LoadLibrary(), LoadLibraryEx()
  • GetProcAddress()
  • FreeLibrary()

In Linux environment, there are other set of APIs

  • dlopen()
  • dlsym()
  • dlclose()


Reference

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox