How to resolve linking error - static lib iPhone

妖精的绣舞 提交于 2019-12-01 06:14:48

问题


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 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.


回答1:


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.

Otherwise you must add your library path to the "Other linker flags" build setting in Xcode project or target info.

See Implementing Static Libraries In iPhone also.



来源:https://stackoverflow.com/questions/1129877/how-to-resolve-linking-error-static-lib-iphone

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