[英]how to link shared library against other shared library in linux?
My application dynamically loads liba.so
(with dlopen
). 我的应用程序动态加载
liba.so
(使用dlopen
)。
liba.so
uses libb.so
so I want to link liba.so
against libb.so
. liba.so
使用libb.so
因此我想将liba.so
与libb.so
链接。 How to do this in Linux? 在Linux中如何做到这一点?
Thanks in advance. 提前致谢。
If you build liba.so
yourself, you need to link it with -l
option 如果您自己构建
liba.so
,则需要使用-l
选项将其链接
gcc -o liba.so liba.o -L/libb/path -lb
If you don't have liba
sources, perhaps you could create libawrapper.so
linked against liba
and libb
and to load dynamically this library 如果没有
liba
源,则可以创建与liba
和libb
链接的libawrapper.so
并动态加载该库
gcc -o libawrap.so -L/liba/ -L/libb/ -la -lb
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.