Cannot build an embedded static lib project that runs in iPhone Simulator
| Originator: | numericalgarden | ||
| Number: | rdar://13033098 | Date Originated: | 17-Jan-2013 10:23 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | XCode 4 |
| Classification: | Other Bug | Reproducible: | Always |
17-Jan-2013 10:23 AM Michael Bishop: Summary: Apple has documentation relating to creating a static library project that you can embed in your iOS Application workspace. This only works when building for the device (arm). When building the application for the simulator, the library is not linked in. See "Tools Workflow Guide for iOS"/"Developing a Static Library and Incorporating It in Your App" Steps to Reproduce: I've made an xcode workspace and 2 projects in the enclosed zip that implement this documentation. 1. Unzip and open the workspace in Xcode 4 2. Build the scheme "StaticLibTestApplication > iPad 6.0 Simulator" 3. Not the resulting build errors. 4. Note the implementation of HPAppDelegate - application:didFinishLaunchingWithOptions: which uses an object in the static library. Expected Results: I expected this configuration to work for both the "iOS Device" destination AND the "iOS iPad/iPhone Simulator" destinations. Actual Results: I received linking errors for the "iOS iPad/iPhone Simulator"scheme destinations. Regression: Notes: I understand WHY this is happening. There is only on product in the static library project and it is only for the arm architecture. The bug is that it should be this easy to make it for the simulator as well. Indeed, there are countless blog posts showing how to hack XCode 4 to build a "universal static library" that will run on the device AND in the simulator. But they are pretty gross hacks. Really, I'd expect it to "just work" as shown in the included project and Apple's documentation. Here are some of the blog posts... http://www.pixiapps.com/blog/?p=116 http://stackoverflow.com/questions/7744663/build-static-library-in-xcode-4-for-iphone-simulator http://blog.boreal-kiss.net/2011/03/15/how-to-create-universal-static-libraries-on-xcode-4/ http://spin.atomicobject.com/2011/12/13/building-a-universal-framework-for-ios/ http://www.stewgleadow.com/blog/2011/10/28/universal-static-libraries-and-frameworks-for-ios/ http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/ 17-Jan-2013 10:23 AM Michael Bishop: 'static_library_xcode_bug.zip' was successfully uploaded
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!