简体   繁体   English

在 iPhone 5s 64 位上运行 32 位库

[英]Run 32 bit library on iPhone 5s 64 bit

I'am using zbar in my application.我在我的应用程序中使用zbar If I want to run it on my iPhone 5s with an 64 bit processor, I get the following errors:如果我想在带有 64 位处理器的 iPhone 5s 上运行它,我会收到以下错误:

尝试在我的 iPhone 5s 上运行

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 位设备上使用 32 位库,因为我不认为,该库将被更新。

To summarize the comments above.总结一下上面的评论。 A 64bit iPhone application requires all constituent libraries and frameworks to be 64bit. 64 位 iPhone 应用程序要求所有组成库和框架都是 64 位。 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.从长远来看,将应用程序保留为 32 位并不是最佳选择,因为一旦运行单个 32 位应用程序,iOS 就必须保持加载两个版本的系统库(32 位和 64 位)。 Hence, you don't want to be the last app to support 64bit!因此,您不想成为最后一个支持 64 位的应用程序!

You can check if your library contains 64bit code using lipo.您可以使用 lipo 检查您的库是否包含 64 位代码。 For example, here's the SBJson framework in 32bit:例如,这是 32 位的 SBJson 框架:

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

and with 64bit code和 64 位代码

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

In the case of zbar, if it's not available you could always try compiling yourself from source.在 zbar 的情况下,如果它不可用,您总是可以尝试从源代码编译自己。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM