undefined

编译链接过程: https://blog.csdn.net/Mr_H9527/article/details/81156112

如何生成静态库和动态库:https://blog.csdn.net/qq_34199383/article/details/80308782

编译链接动态库之后,运行找不到库:https://blog.csdn.net/liu0808/article/details/81169173

c/c++符号隐藏与依赖管理:https://www.jianshu.com/p/97d28e4613a7

一、Linux 动态链接库的加载顺序

1
2
3
4
5
1. 编译时指定的 run path
2. LD_LIBRARY_PATH 指定的地方
3. ldconfig 指定的地方
4. /lib
5. /usr/lib

二、生成动态库

gcc 常用编译选项

1
2
3
4
5
-static: 链接静态库,禁止使用动态库
-shared:链接动态库
-Ldir: 搜索路径中增加 dir 目录
-lname:链接静态库(libname.a)或动态库(libname.so)的库文件
-fPIC:生成使用相对地址无关的目标代码

动态库加载函数 dlsym 的使用:https://zhuanlan.zhihu.com/p/486750201