Arm64 architecture issue with iOS

Hello everyone,

I am trying to use the iOS version of ORB_SLAM2 (GitHub - ygx2011/ORB_SLAM2-IOS: ORB_SLAM2 for iOS.) as a plugin to a Unity (Unity 5.5) project. To be able to use this as a plugin, I created a static library (.a file placed in Assets/Plugins/iOS/ directory) from the above iOS app, that can be used to subclass the UnityAppController.

Now, in the Unity player settings, I changed the scripting backend to IL2CPP and the architecture to arm64. The reason I did this is because according to the Unity 5.5 Legacy documentation, IL2CPP is the only scripting backend to support deploying to ARM 64-bit on iOS.

When I build and run the generated Xcode project, I get the following errors with regards to arm64 architecture.

I noticed that most of these errors occurs in opencv functions, so I cross checked if the opencv2.framework included in the project is built with arm64 support. But from the opencv forums it’s mentioned the latest version of opencv does support arm64 (I cloned the opencv GitHub repository and followed these instructions on the opencv documentation to generate the framework). I’ve already played around with the commonly recommended solutions from posts like ios - How to update our static library architecture for suporting arm64 Build? - Stack Overflow , [SOLVED]Apple Mach-O Linker Error when Building - Questions & Answers - Unity Discussions, ios - Undefined symbols for architecture armv7 - Stack Overflow, etc. From the forums I’ve come across, the following build settings have worked for others.

I’m a beginner in both Unity & iOS and any help would be really appreciated. I use Unity 5.5.2f1, Xcode 9 beta 3 and an iPhone 7 Plus with iOS 11 beta 4 for my project.

P.S. The ORB_SLAM2-IOS works fine if compiled directly as an iOS app. The problem occurs only when I try to use it as a static library.

Thanks!

It looks like you might be missing another static library that ORB_SLAM2 needs. Maybe it is the opencv2.framework (you can try adding that in Xcode), but I’m not sure.

I’ve already added the opencv2.framework and changed the framework search path in the build settings accordingly.

I’m not sure then. Maybe it is worth checking the differences between the Xcode project where ORB_SLAM2 works by itself, and the one that Unity generates.