I'm attempting to use some C code in a Swift project for iOS.
The C code comes with a makefile that will compile a static .a library for the x86_64 architecture. Obviously, to use this code in iOS we need arm64 compatibility.
I've tried a few different approaches including:
- Throwing the C source and header files directly into the project, listing the C header in the bridging header.
- Same as approach #1 but routing my C calls through an Objective-C intermediary.
- Using Swift Package Manager to package up the C code into a framework I can drop into the project.
On approaches #1 and #2, Xcode is giving me code completion and syntax highlighting so I know the C headers are being picked up but at compile time I get error:
Undefined symbols for architecture arm64
If I try to call a simple C function I wrote myself, everything works fine. So I'm wondering if there's something in the lower level C I'm trying to use that is incompatible with arm64 or if I may simply need to modify something in my Xcode build settings.