Duplicate symbols issue with 2 third party libraries in Xcode

时间秒杀一切 提交于 2019-12-21 12:31:39

问题


I'm trying to compile a project that depends on 2 third party static libraries.

The issue is that both third parties have included the same set of "utility" classes in their static library distribution, meaning that I am getting dozens of duplicate symbol errors when both are added to my project.

Is there a way for me to force the project to compile and/or ignore one of the duplicate symbols somehow?

I found a similar question with answer here two static libraries with duplicate symbols in Xcode but I am interested to see if there is a compiler flag that might do the trick (please note that in this case I am assuming that both symbols represent the same object).

Thanks Rog


回答1:


Try merge them into one file via libtool (libtool -o merged.a file1.a file2.a) or check How can I avoid “duplicate symbol” errors in xcode with shared static libraries? or/and Solving “Duplicate Symbol” Error When Setting Up GorillaLogic’s FoneMonkey 5




回答2:


Just find the duplicate symbol file and rename one of the library corresponding files. Be aware that you should check all compiled sources of the project that you are renaming. Xcode won't change the references automatically.



来源:https://stackoverflow.com/questions/12829564/duplicate-symbols-issue-with-2-third-party-libraries-in-xcode

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