动态库映像不包含x86_64,i386体系结构 [英] Dynamic library image doesn't contain x86_64, i386 architectures

查看:487
本文介绍了动态库映像不包含x86_64,i386体系结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为iOS构建动态库,并结合体系结构

I'm trying to build dynamic library for iOS, combined with architectures


  • armv7

  • armv7s

  • arm64

  • i386

  • x86_64

  • armv7
  • armv7s
  • arm64
  • i386
  • x86_64

这是我的目标构建设置

Here is my target's Build Settings

如您所见,我已将x86_64和i386添加到架构有效架构,还仅构建活动架构设置为

As you can see I've added x86_64 and i386 to Architectures and Valid Architectures, also Build Active Architecture Only is set to NO.

所以在构建我的二进制文件之后,我通过在终端中运行文件myDl.dylib 来检查支持的体系结构

So after building my binary, I'm checking supported architectures by running file myDl.dylib in Terminal

myDl.dylib (for architecture armv7):    Mach-O dynamically linked shared library arm  
myDl.dylib (for architecture arm64):    Mach-O 64-bit dynamically linked shared library

所以这意味着它已经为 armv7 编译了 arm64 dlopen()在模拟器上失败,错误为Unsupported architecture。

So it means it has been compiled for armv7 and arm64, and dlopen() fails on simulator with error "Unsupported architecture".

我做错了什么?

PS。当我使用自定义构建脚本并使用lipo工具来创建胖库时,它工作正常,但我不喜欢这种方式,我想在Xcode上正常工作。

推荐答案

在有效的体系结构中设置armv7,armv7s和arm64,并确保使用任何必须包含64位支持的第三方框架。

Set armv7,armv7s and arm64 in valid architecture and make sure if you use any thirdparty framework that must be include 64 bit support.

这篇关于动态库映像不包含x86_64,i386体系结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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