Build Static Library in Xcode 4.6 for Simulator

独自空忆成欢 提交于 2019-12-11 08:27:41

问题


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:


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



来源:https://stackoverflow.com/questions/14809825/build-static-library-in-xcode-4-6-for-simulator

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