如何解决链接错误-静态lib iPhone [英] How to resolve linking error - static lib iPhone
问题描述
我曾尝试在iPhone上创建静态库,但无法在其他项目中使用它.我收到此错误:
I have tried making a static lib on my iPhone but I am not able to use it in another project. I am getting this error:
.objc_class_name_XMLParser", referenced from:
literal-pointer@__OBJC@__cls_refs@XMLParser in Minutes2MidnightViewController.o
".objc_class_name_TickerViewController", referenced from:
literal-pointer@__OBJC@__cls_refs@TickerViewController in Minutes2MidnightViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
XML
和Ticker
是我的类,我在静态lib中使用它们,而"MinutesToMidnight"
是我正在使用此静态Lib的项目.我认为这与链接器错误有关,请帮助我解决此问题.
XML
and Ticker
are my classes, I am using them in static lib is made and "MinutesToMidnight"
is the project I am using this static Lib. I think this is something related to Linker error, please help me resolve this issue.
推荐答案
如果要交叉引用静态lib项目,则必须将lib图标从其项目组拖放到使用库链接二进制文件"目标组.
If you are cross-referencing the static lib project you must drag and drop your lib icon from its project group to the "Link binary with libraries" target group.
否则,必须将库路径添加到Xcode项目或目标信息中的其他链接器标志"构建设置中.
Otherwise you must add your library path to the "Other linker flags" build setting in Xcode project or target info.
另请参见在iPhone中实现静态库.
这篇关于如何解决链接错误-静态lib iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!