what is the difference between linking and loading in c language

后端 未结 7 1665
庸人自扰
庸人自扰 2021-02-04 06:15

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?

相关标签:
7条回答
  • 2021-02-04 07:07

    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.

    0 讨论(0)
提交回复
热议问题