在 iPhone 5s 64 位上运行 32 位库 [英] Run 32 bit library on iPhone 5s 64 bit

查看:43
本文介绍了在 iPhone 5s 64 位上运行 32 位库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用 zbar.如果我想在配备 64 位处理器的 iPhone 5s 上运行它,我会收到以下错误:

I'am using zbar in my application. If I want to run it on my iPhone 5s with an 64 bit processor, I get the following errors:

是否可以在 64 位设备上使用 32 位库,因为我不认为,库会被更新.

Is it possible to use the 32 bit library on a 64 bit device, because I don't think, the library is going to be updated.

推荐答案

总结以上评论.64 位 iPhone 应用程序要求所有组成库和框架都是 64 位.你不能混搭.从长远来看,将应用程序保留为 32 位并不是最佳选择,因为一旦运行单个 32 位应用程序,iOS 就必须保持加载两个版本的系统库(32 位和 64 位).因此,您不想成为最后一个支持 64 位的应用!

To summarize the comments above. A 64bit iPhone application requires all constituent libraries and frameworks to be 64bit. You can't mix and match. Leaving an application 32bit is non-optimal long term since iOS has to keep two versions of the system libraries loaded (32 and 64) as soon as a single 32bit app is run. Hence, you don't want to be the last app to support 64bit!

您可以使用 lipo 检查您的库是否包含 64 位代码.例如,这里是 32 位的 SBJson 框架:

You can check if your library contains 64bit code using lipo. For example, here's the SBJson framework in 32bit:

$ lipo -info SBJson.framework/SBJson 
Architectures in the fat file: SBJson.framework/SBJson are: armv6 armv7 i386 

和 64 位代码

$ lipo -info SBJson.framework/SBJson
Architectures in the fat file: SBJson.framework/SBJson are: armv7 armv7s i386 x86_64 arm64 

对于 zbar,如果它不可用,您可以随时尝试从源代码编译自己.

In the case of zbar, if it's not available you could always try compiling yourself from source.

这篇关于在 iPhone 5s 64 位上运行 32 位库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆