Does linking and loading of the the dynamic libraries both happen at runtime? or is it that only loading of the library happens at run time?
Both dynamic linking and library loading happen at run time, but dynamic linking is done prior to program execution and is done by system linker. So for example, if required libraries are missing, program cannot be executed. Library loading, on the other hand, is done by program itself, via dlopen/LoadLibrary functions. In this case, loading process is controlled by application, which can, for example handle errors.