0
votes

I am created static library files and added that in to My Project XCode while compile it's throughs Apple Mach-O Linker Error,

My Static libraries
1.libMathLibrary.a
2.libDineshLibrary.a

I have checked

  1. Target->Build Phases ->Link Binary with Libraries my static library added

  2. LIBRARY_SEARCH_PATHS = $(inherited) "$(SRCROOT)/staticlb/libMathLibrary" "$(SRCROOT)/staticlb/libDineshLibrary" add static library path.

How to I resolve this problem. Please share your ideas, I hope it will help me..Thank you.

1
which linker error are you getting ? - hpp
libDineshLibrary static library link error Undefined symbols for architecture armv7s: "_OBJC_CLASS_$_libDineshLibrary", referenced from: objc-class-ref in ViewController.o - GR.
make sure that you have added all the required frameworks. - hpp
I found when i created static library in simulator mode it will support xcode with simulator compelling only when it compile in device it will through linker errors vise-versa in device also. - GR.
This is link I referred to create static library: icodeblog.com/2011/04/07/creating-static-libraries-for-ios - GR.

1 Answers

0
votes

I found solution for my problem

After created your own static .a extension library files

1. **libdevice.a** (device mode compile static library file)
2. **libsimulator.a** (simulator mode compile static library file)

Please convert two compile mode static libraries to one common static .a extension library

in your terminal

lipo -create libdevice.a libsimulator.a -output libcommonlibrary.a

The new libcommonlibrary.a common static library file will support both simulator and device compilation.

please ref link: http://blog.boreal-kiss.net/2011/03/15/how-to-create-universal-static-libraries-on-xcode-4/