1.

What Is Implicit And Explicit Linking In Dynamic Loading?

Answer»

Implicit Dynamic Linking or loading: When application or client uses its import table to link the external symbol/functions, it is called implicit linking. In implicit linking application USE prototype header and import library to link an external symbol.

Example: Suppose we have a third party math library and add() is a function/interface we are using in our application.

Then the following steps are needed

  1. include the math.h where add() prototype is there as a import function for COMPILATION,
  2. include math.lib for linking.
  3. place math.dll DLL at the path of our application.

Explicit Dynamic Linking/Loading: When application does not link the external symbol by import library RATHER it loads the DLL at runtime. It does the same MECHANISM as operating system does during loading of the implicit linked DLL calls.

This is done by using Win32 APIS like:

  • LoadLibrary() - loads and links a input library form the DLL path, or current path,
  • GetProcAddress() - finds the symbol/function address by its name for a loaded DLL
  • FreeLibrary() - unloads the loaded DLL instance

Implicit Dynamic Linking or loading: When application or client uses its import table to link the external symbol/functions, it is called implicit linking. In implicit linking application use prototype header and import library to link an external symbol.

Example: Suppose we have a third party math library and add() is a function/interface we are using in our application.

Then the following steps are needed

Explicit Dynamic Linking/Loading: When application does not link the external symbol by import library rather it loads the DLL at runtime. It does the same mechanism as operating system does during loading of the implicit linked DLL calls.

This is done by using Win32 APIs like:



Discussion

No Comment Found