Currently I'm working on a Framework, written in C, which was planned to encapsulate different C libraries around the topic of Spatial / GIS data. To compile those C libraries (mainly GEOS and Proj.4) there is even a github project which downloads the source code and compiles it all for iOS and Simulator.
I linked it into my framework, added a Module map to be able to call the C methods from within Swift and wrote my Swift class.
Checked with XCTest that the correct methods are called correctly. Everything is awesome.
I hooked up the framework in my iOS app, run it in the simulator: Everything is awesome.
I ran it on my device and got null pointers when calling the C functions. And I began to wonder.
To be honest, I haven't had the necessity (until now) to spend too much time on linking issues in C/C++/ObjC so I'm not quite sure what I've missed:
- The module.map points on the header files of those libraries relatively (using [extern_c]).
- The "Runpath Search Paths" points to the directory containing the .a files
- The "Header Search Paths" points to the directory containing all the .h files
- The "Library Search Paths" also points to the directory containing the .a fiels
- The .a files are dragged into the projects "Linked Frameworks and Libraries"
Can I somehow verify if the libraries are statically linked into my framework?
And what might I have missed which causes the libs to not be included? (Or isn't that possible?)