I am creating a MyLibrary static library for iOS in Objective-C that combines dozens of useful classes, each with its own .h file. I would like to distribute MyLibrary as one compiled binary, libMyLibrary.a and one .h header file, MyLibraryAPI.h . MyLibraryAPI.h has a dozen #import statements, one for each of MyLibrary dozen open classes. Developers who want to include MyLibrary in their host projects should only include the binary file libMyLibrary.a and MyLibraryAPI.h . This is the goal.
So, I installed the Role each public class in the MyLibrary Xcode project on Public and built libMyLibrary.a successfully using the Xcode and lipo command-line build lipo . Then I manually included all the dozens of MyLibrary header MyLibrary along with libMyLibrary.a in the host project, and the host project can use the public MyLibrary classes without problems. Excellent!
The problem is that I delete these dozens of header files and use MyLibraryAPI.h (like my goal), the host project classes can no longer find the MyLibrary header files referenced in MyLibraryAPI.h . Instead, during compilation, I get errors like: MyAwesomeThingDelegate.h: No such file or directory... for every MyLibrary class that I'm trying to execute #import in MyLibraryAPI.h . I have a folder in the root directory of my host project with the name lib , and in the host build settings the search path for the recursive header to lib/** and in the library search path, set the recursive path to lib/** .
I would like to hear community suggestions on how to properly set the host project search paths, so I need to enable libMyLibrary.a and MyLibraryAPI.h to use MyLibrary classes. Or, if I am doing something wrong, I would like to hear another sentence in order to achieve my goal of distributing one binary and one API header file.
source share