-all_load 其他链接器标志导致第 3 方框架中的重复符号错误 [英] -all_load other linker flag causing duplicate symbol errors in 3rd party framework

查看:51
本文介绍了-all_load 其他链接器标志导致第 3 方框架中的重复符号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于内部应用的静态库,其中包含一些常见的实用程序代码.从以前的 SO 帖子中,我发现为了在运行时加载静态库中的类别,我需要在 Build Settings 的 Other Linker Flags 字段中包含 -all_load -ObjC.

I have a static library we use for in-house apps that contains some common utility code. From previous SO posts, I have found that in order to get categories in the static library to be loaded at run-time, I need to include -all_load -ObjC in the Other Linker Flags field in Build Settings.

但是,对于我也在使用的闭源第 3 方库,如果我使用这些标志,我会收到几个重复的符号错误.我已经验证我可以通过去掉这些标志来构建应用程序,但是当然,在运行时我会在使用类别方法时遇到无法识别的选择器崩溃.

However, with a closed-source, 3rd party library that I am also using, if I use these flags, I get several duplicate symbol errors. I have verified that I can get the app to build by taking these flags out, but of course, at runtime I get unrecognized selector crashes when using category methods.

有什么方法可以将 -all_load -ObjC 定位为仅应用于我的静态库,不知何故?

Is there any way to target the -all_load -ObjC to only be applied to my static library, somehow?

谢谢!

推荐答案

尝试改用 -force_load 标志

Try using the -force_load flag instead

检查这个 发帖了解更多详情.

check this post for more details.

这篇关于-all_load 其他链接器标志导致第 3 方框架中的重复符号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆