Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top