- 论坛徽章:
- 0
|
头文件不互相引用?引用头文件跟写 extern foo(); 有什么区别?本质是一样的,写两次反而还容易出错。
如果真的想解耦合,那么应该在so中提供接口,由外部将frame_read的函数指针传进去,内部只调用函数指针,这样才是更好的解耦合
如果要想达到你现在的效果,那么主函数链接时加个 -rdynamic 参数吧,具体 man dlopen
External references in the library are resolved using the libraries in that library’s dependency list and any other libraries
previously opened with the RTLD_GLOBAL flag. If the executable was linked with the flag "-rdynamic" (or, synonymously,
"--export-dynamic"), then the global symbols in the executable will also be used to resolve references in a dynamically
loaded library.
|
|