1
votes

How to build a static library for simulator on Xcode 4.6?

I've tried "https://github.com/kstenerud/iOS-Universal-Framework". But got an error while using that framework on demo.

Error is like:

ld: warning: ignoring file /Users/shuvo/test_lib/Demo(V.1)/myProject.lib/libMyProjectLibrary.a, missing required architecture i386 in file /Users/shuvo/test_lib/Demo(V.1)/myProject.lib/libMyProjectLibrary.a (2 slices) Undefined symbols for architecture i386: "_OBJC_CLASS_$_showScreen", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

1
Looks like you are doing more than just building a static library if the linker is involved. I suspect you have 2 projects (one a static library and the other an app) and the static library is a dependency of the app?trojanfoe

1 Answers

0
votes

I came across the same problem,and solve it by setting the static lib's run configuration as Release in the scheme editor.

here is the words in the document of iOS-Universal-Framework, section "Building your iOS Framework":

step 2.(optional) Set the "Run" configuration in the scheme editor. It's set to Debug by default but you'll probably want to change it to "Release" when you're ready to distribute your framework.

the key is the "Build Active Architecture Only" in Build Settings, Debug is set to NO by default