Using a C++ Static Library in Swift

50 views Asked by At

What is the best way to import a static c++ library in swift?

I am working with a 3rd party library (FBX SDK) which is in the form of header files and a ".a" file.

Ideally I would use the new interop features of swift and not have to use objective-c.

I have tried different method but none of them seemed to work since the library is in c++. I have tried using a bridging header but the headers from FBXSDK's are invalid to objective c even after enabling C++ / Objective-C++ Interoperability. I have tried packaging the library in a swift package and I have tried importing it using a modulemap.

0

There are 0 answers