Linux equivalent of Windows DLL forwarders or MacOS reexport_library

谁说我不能喝 提交于 2019-12-01 23:07:36

Someone outside StackOverflow gave me a solution to my problem.

A .so file doesn't need to be an actual ELF file. It can also be a linker script. A linker script is a text file that contains instructions for the linker. In my case, the script is very simple. I simply install this text file as libmine.so:

INPUT ( /install/prefix/lib/libmine.so.1 -lother )

This instructs the linker to, at the point where libmine.so (or -lmine) appears in the command line, to look for my library (with version suffix, so it picks up the actual ELF file), and then search the library paths for the other library.

Then I just substitute /install/prefix with the actual configured install prefix in my build script and I'm good to go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!