Hello Apple Team,
I'm trying to import the Audodesk FBX SDK to my Objective-C iOS Project. The SDK is written in C++, but has support for iOS and the iOS simulator architectures.
I've added the path to the include folder in the Header Search Path I've also added the paths to libfbxsdk.a in the Library Search Paths Finally, I've added the libfbxsdk.a file to the Link Binary with Libraries.
However, when I build the project, I get the following error:
building for 'iOS', but linking in object file (/Users/Lond/Documents/v2/Autodesk/iOS/2020.3.7/lib/ios/debug/libfbxsdk.a[28](fbxalloc.cxx.o)) built for 'macOS'
In the terminal, if I type the command:
lipo -info libfbxsdk.a
I get the message
Non-fat file: libfbxsdk.a is architecture: arm64
confirming that I'm using the library for the correct architecture. Do I need to add any other confifuration option? (Like the other linker flag or something else)
I'm quite new to C++, and integrating a C++ SDK into iOS is not easy. I'm using Mac Os Sonoma 14.6.1 Tested on Xcode 15.4 and 16.2 Target Device: iPhone 13 Pro (iOS 17.6.1) iOS FBX SDK version: 2020.3.7
Link to the SDK if needed: https://aps.autodesk.com/developer/overview/fbx-sdk Any help would be greatly appreciated Thank you
all the static libraries are macOS.
Well, that’s not good )-:
emal6465, I want to make sure you’ve seen An Apple Library Primer, which explains a lot of the background to this issue. In short, code is built for a specific platform and within that for a specific architecture. You can’t use code for the wrong platform every if it has the right architecture. This is a really important distinction right now because all our platforms [1] use the same arm64
architecture.
If you’re building an SDK for others to use then the best option is to create an XCFramework. My primer has links to info on how to do that. However, if you’re consuming an SDK then there’s no supported way to use a library for platform A on platform B )-:
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Except watchOS.