开发者

how to link shared library against other shared library in linux?

My application dynamically loads liba.so (with dlopen).

开发者_运维百科 liba.so uses libb.so so I want to link liba.so against libb.so. How to do this in Linux?

Thanks in advance.


If you build liba.so yourself, you need to link it with -l option

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

gcc -o libawrap.so -L/liba/ -L/libb/ -la -lb
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜