开发者

When creating a universal application, how to link to a framework with separated 32bit and 64bit version?

My situation:

  • I want to create a universal application of i386 and x86_64 in Xcode 3.2.2
  • This application has a dependent third-party framework.
  • This framework only has separated versions for i386 and x86_64, no universal version.
  • I added both of the i386 and x86_64 versions into the Link Binary With Libraries section of my target.

My problem:

Xcode cannot find symbols from the framework when building a x86_64 version. Looks like Xcode only search symbols in the i386 version of framework, by command line arguments "-framework $FRAMEWORK_NAME".

My question:

How could I make Xcode al开发者_如何学Pythonso search symbols from the x86_64 framework? Or is it possible to link to a non-universal library when building a universal application?

My progress:

I guess that creating a universal version of this framework by lipo maybe solves this problem, but if possible, I would like to avoid this. Because it involves some external changes.

Thanks


You can create two versions of your app and lipo them together, but it's probably easiest if you just lipo the framework itself. There's no reason you need to affect the external library's build process; you can just do it in place as part of the build process for your own app.


Alternatively, you could link two separate versions of your app, and the join those with lipo.


Getting the framework to build fat (or lipoing together the two slices) is by far the most elegant solution. Is there a reason to not do that?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜