linux中有共享库。例如,libcap.so.2.24。
当我写一些类似的东西时,我知道当我编写c代码时
#include <stdio.h>
int main(){
printf("hello world\n");
return 0;
}
gcc编译将自动包含库中的printf函数并生成异议文件。
我的问题是
1) The compiler only includes the header files, not the library itself
2) During linking the library is bound to the executable.
How this happens depends if static or dynamic linking is used
3) It is possible to bind a library at runtime with the dlopen library function
and then use dlsym to get a function pointer.
The dlopen man page has a very nice example