I want to create a iOS framework for a popular C library.
My Current Setup:
This is what I'm doing:
- Build the library for iOS and iPhone simulator architectures
- Combine the two archive
.afiles into a single fat library usinglipo - Use
libtool -static -oto get the final library
By this stage I have a binary and a bunch of header files. In xcode:
Drop the binary (from step 3) and ensure its linked under:
Target > General > Framework and Libraries, andTarget > Build Phases > Link Binary with LibrariesI copy all the header files from the C library and place them under dir
Dependencies/myClibrary/include/. Theincludedir contains a master header filemyClibrary.hwhich includes a number of header files from./abstract/*.h.At top level of the xcode project dir, I also create a
module.mapfile with content:
module MyWrapperFramework [system] {
header "Dependencies/myClibrary/include/myClibrary.h"
export *
}
Add all header files to xcode and for each header file, under
Target Membershipchange value fromprojecttopublic.Build
Testing the framework in an App
I am able to build the framework, with settings as mentioned above. However, when I want to test it in a test Objective C app, I import the framework and call functions related to the myClibrary. On building the app, I get the error:
'myClibrary/abstract/headername.h' file not found
The above error originates from myClibrary's master header file myClibrary.
Most of the tutorial that I could find deals with C libraries having a single header file. How can I create a iOS framework from a C library that contains nested header files?
In case, nested header files are not the main issue here, what am i doing wrong?