Run 32 bit library on iPhone 5s 64 bit

2020-02-14 04:50发布

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:

Trying to run on my 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.

1条回答
干净又极端
2楼-- · 2020-02-14 05:17

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!

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 

and with 64bit code

$ 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.

查看更多
登录 后发表回答