title: Static Library path nightmare from hell
body: <p>This is the point. I have a subproject (static library) created. The library compiles well. No errors. When I include this library inside a project and imports a header from that library on the project the library fails to compile because it cannot find a path that belongs to itself.</p>
  
  <p>After following a bunch of tutorials on the web on how to create a static library and embed that in a project, I don't know which one is the correct one, because I have tried all and all failed and some differ.</p>
  
  <p>This is how the library is set:</p>
  
  <hr>
  
  <p><strong>STATIC LIBRARY</strong></p>
  
  <p><strong>BUILD SETTINGS:</strong></p>
  
  <ol>
  <li>Public header folder path = <code>$(BUILT_PRODUCTS_DIR)</code></li>
  <li>Header search path = <code>$(SRCROOT)</code> <em>(recursive)</em></li>
  </ol>
  
  <p><strong>BUILD PHASES</strong></p>
  
  <p>COPY FILES = 1 file, myLibrary.h that is basically empty (created by xcode when I used the static library template to start the library.</p>
  
  <p>no <strong>ADD COPY HEADERS</strong> phase</p>
  
  <hr>
  
  <p><strong>MAIN PROJECT</strong></p>
  
  <p><strong>BUILD SETTINGS</strong></p>
  
  <ol>
  <li>Header search path = empty</li>
  <li>User header search path = <code>$(BUILT_PRODUCTS_DIR)</code> <em>(recursive)</em></li>
  <li>Always search user paths = <code>YES</code></li>
  </ol>
  
  <p><strong>BUILD PHASES</strong></p>
  
  <ol>
  <li>Yes, <code>myLibrary.a</code> is on target dependencies
  <hr></li>
  </ol>
  
  <p>What amazes me is that the library compiles fine alone but when put inside a project, is unable to find a header that belongs to the own library.</p>
  
  <p>NOTE: I have also tried to create a copy headers phase on the library making public all <code>.h</code> on that library, but it failed too.</p>
  
  <p>This is an example of one error:</p>
  
  <pre><code>/Users/mike/Library/Developer/Xcode/DerivedData/MyApp-dnaimaovscreasadhmvgttwjnabc/Build/Products/Debug-iphoneos/include/myLibrary/ccTypes.h:39:9:
  fatal error: 'Platforms/CCGL.h' file not found
  #import "Platforms/CCGL.h"
  </code></pre>
  
  <p>I have lost two days trying to solve this nightmare.</p>
  
  <p>any thoughts?</p>
  
  <p>I have uploaded a sample project to <strong><a href="http://dfiles.eu/files/vj7egy9ig">here</a></strong> and <strong><a href="http://www.sendspace.com/file/dfvs09">here</a></strong></p>