Linking archives (.a) into shared object (.so)

可紊 提交于 2019-11-28 17:56:26

symbols/object files in .a files that's not used, will be discarded by the linker.

Use -Wl,--whole-archive for the linking to include the entire .a file Edit, you'll need to add -Wl,--no-whole-archive after you specify your library as well, so the whole thing will be -Wl,--whole-archive archive1.a archive2.a -Wl,--no-whole-archive

Regarding your edit: Put "-Wl,--no-whole-archive" at the end of the link command you're running. That fixed it for me.

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