具有动态库的32位应用程序在64位设备上崩溃 [英] 32-bit App with dynamic library crash on 64-bit device

查看:217
本文介绍了具有动态库的32位应用程序在64位设备上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临以下情况:


  • 32位设备+应用程序armv7 +动态库armv7 arm64 =​​
    工作

  • 64位设备+应用程序armv7 +动态库armv7 arm64 =​​
    不起作用

  • 32 bit device + app armv7 + dynamic library armv7 arm64 = work
  • 64 bit device + app armv7 + dynamic library armv7 arm64 = doesn't work

不起作用-应用程序加载时崩溃,出现以下错误:

doesn't work - app crashes on load with the following error:


dyld错误消息库未加载原因找不到合适的图像

dyld error message library not loaded reason no suitable image found

有什么解释吗?

推荐答案

说明:在64位设备上加载的32位二进制文​​件无法执行此操作,因为已将32位页面大小设置为在iOS 9中从4096字节更改为16384字节。

Explanation: 32 bit binaries loaded on 64 bit devices fail to do so since the 32 bit pagesize has been changed from 4096 bytes to 16384 bytes in iOS 9.

结论:具有动态库的32位应用程序无法在64位设备上运行。

Conclusion: 32-bit apps with dynamic libraries cannot run on 64-bit devices.

解决方案(两个就足够了):


  • 将新条目添加到其他链接器标志i在动态库项目中:

  • Add a new entry to Other linker flags in the dynamic library project:


-Wl,-segalign,4000

-Wl,-segalign,4000


  • 更新应用程序本身以支持arm64架构

  • 这篇关于具有动态库的32位应用程序在64位设备上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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