Iphone Link Static Library
-
24-09-2019 - |
Question
I have created a static library in XCode called TestLib. I then created a simple test project that will use this library. I dragged the TestLib xcode project into my test project (frameworks section - if it matters), and set TestLib as a direct dependency of the test project.
I am having trouble importing header files from the Library, I only have 1 in there (its a test project) called TestLibHeader.h, but no matter how I attempt to import them, I get compile errors stating that the header file cannot be found.
Where am I going wrong?
Solution
You need to tell your build target where to look for the header files for a given build configuration.
in XCode 3.x
- Double click on your build target.
- Click on the
Build
tab. - Search for the build setting
Header Search Paths
- Set
Header Search Paths
to include the path the header files in your library project.
See the instructions for setting up three20 as a dependency for a good example of these steps in action.