Issue Integrating C++ SDK

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

Answered by DTS Engineer in 823049022
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.

I don't think you're doing anything wrong. I downloaded that SDK. It's not even signed. When I checked, all the static libraries are macOS. The included examples are strictly for Windows.

I have no idea what's going on there.

Thanks for checking @Etresoft Indeed, it looks like they don't care about the iOS developers. There's no documentation at all for it.

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.

Issue Integrating C++ SDK
 
 
Q