This topic created in 2190 days ago, the information mentioned may be changed or developed.
5 replies • 2020-11-09 14:54:16 +08:00
 |
|
dlopen
|
 |
|
那不就是个插件系统?
|
 |
|
1 楼的方法可以的。代码里去判断有没有这个库,有就打开它然后根据符号找到函数,没有就跳过去。。
|
 |
|
具体点讲吧。 1. dlopen 加载动态库 2. dlsym 将库函数绑定至函数指针 3. 通过函数指针调用库 4. dlclose 关闭动态库
|