1
votes

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?

1
are you copying the header files in the new project or just referencing them? - Anurag
Do I need to copy them in? I thought they would simply be compiled as part of the lib. - Mick Walker

1 Answers

0
votes

You need to tell your build target where to look for the header files for a given build configuration.

in XCode 3.x

  1. Double click on your build target.
  2. Click on the Build tab.
  3. Search for the build setting Header Search Paths
  4. 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.