XCode 的其他链接器标志中 all_load 的替代方案
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10809304/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Alternative for all_load in XCode's Other Linker Flags
提问by bendytree
I'm adding Rdioto my iOS app and I'm stuck on this part of the installation:
我正在将Rdio添加到我的 iOS 应用程序中,但我在安装的这一部分卡住了:
Add -all_load under Other Linker Flags in the project build info
在项目构建信息中的其他链接器标志下添加 -all_load
If I add that flag, then another third party library breaks giving me the error message:
如果我添加该标志,则另一个第三方库会中断并显示错误消息:
ld: duplicate symbol _vw_chartype_table_p in /Users/josh/ Projects/app/libs/libvt_universal.a(vw_ctype-3279EF26D0C25F3A.o) and / Users/josh/Projects/app/libs/ libvt_universal.a(vw_ctype-34AB9EC0B46D954C.o) for architecture i386
ld:/Users/josh/Projects/app/libs/libvt_universal.a(vw_ctype-3279EF26D0C25F3A.o) 和/Users/josh/Projects/app/libs/libvt_universal.a(vw.6ECtype-4B)中的重复符号_vw_chartype_table_p架构 i386
Is there any way to use the Rdio library without using -all_load?For example, I've tried -force_load $(BUILT_PRODUCTS_DIR)/Rdio.frameworkbut it seems to have no effect.
有没有办法在不使用 -all_load 的情况下使用 Rdio 库?例如,我已经尝试过,-force_load $(BUILT_PRODUCTS_DIR)/Rdio.framework但似乎没有效果。
回答by bendytree
force_load is exactly what you want - it allows you to load only that framework without messing with anything else. The problem is the exact syntax along with a few other unexpected tweaks to your settings.
force_load 正是您想要的 - 它允许您只加载该框架而不会弄乱其他任何东西。问题在于确切的语法以及对设置的其他一些意外调整。
-force_load syntax
-force_load 语法
Force load should be given the path to your object file, not the framework.
强制加载应该给出目标文件的路径,而不是框架。
-force_load $(SOURCE_ROOT)/AppName/libs/Rdio.framework/Versions/Current/Rdio
Other Settings
其他设置
- Remove
Rdio.frameworkfrom the 'Link Binary with Libraries' build phase. - Remove '/libs/Rdio.framework' from my LIBRARY_SEARCH_PATHS
Rdio.framework从“Link Binary with Libraries”构建阶段中删除。- 从我的 LIBRARY_SEARCH_PATHS 中删除“/libs/Rdio.framework”

