【发布时间】:2011-11-05 02:21:44
【问题描述】:
我已阅读有关静态和动态库的信息。 我的问题不大具体
dlopen dlclose:
Benifit of dlopen is we can start the EXE with out
loading the necessary libraries at the begining. Only when we
need we will load the libratries and unload it from the memory.
这是动态链接库的行为。
我的问题是我是否链接库 libUtlities
ld -o EXE main.o -lUtilities
当我运行 EXE 时,libUtlities 会先加载到内存中 我首先使用那里的功能
which i observed in dbx (Solaris debugger)
But will not contribute to the size of the EXE.
1.那么是静态链接还是动态链接。 ?
【问题讨论】:
-
第一个引用是相当虚假的。如果有人为此目的使用动态加载,他们只是让他们的代码变得不必要地丑陋和复杂。动态加载的唯一合法目的是制作一个支持加载新代码的程序在程序本身链接/分发后或由第三方进入程序。
标签: c++ c dynamic static-libraries dlopen