Dynamic library image doesn't contain x86_64, i386 architectures

烂漫一生 提交于 2019-12-06 11:50:14

问题


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

  • armv7
  • armv7s
  • arm64
  • i386
  • x86_64

Here is my target's Build Settings

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.

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

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

What am I doing wrong?

PS. When I use custom build script and use there "lipo" tool to create fat library, it works fine, but I don't like that way, and I want to get it normal working on Xcode.


回答1:


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



来源:https://stackoverflow.com/questions/28108589/dynamic-library-image-doesnt-contain-x86-64-i386-architectures

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!