Duplicate symbol: Include static lib A in static lib B, also include lib A and B in XCode Project

懵懂的女人 提交于 2019-11-30 08:54:41

Although Lib B depends on Lib A you don't actually want to put all the objects from A into B which is what you've done by the looks of it. I'm not sure how you managed that but I would imagine when you built Lib B you linked against Lib A? If so, just omit Lib A from the build line for Lib B. All the symbols from Lib A are meant to be undefined in Lib B.

Static libraries are just archives of object files so the two should be completely separate. When you need to link against Lib B just specify Lib A as well.

acegs

This thread discussed removing the duplicates using commandline tools.

How to handle duplicate symbol error from 3rd party libraries?

They extracted the .o files inside .a files and removed the duplicates then combined again.

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