8

I have a static library iOS project ProjectCore, that I want to include in the project MyProject.

In the library project I set:

PUBLIC_HEADERS_FOLDER_PATH = $(TARGET_NAME)

So I end up with the following structure

libProjectCore.a
ProjectCore (Folder)
+- ProjectCore.h
+- ProjectCoreUtil.h

In the directory /.../DerivedData/MyProject-xyzabcd/Products/Release-iphoneos/

Now I setup MyProject

  • Add ProjectCore as a git submodule next to MyProject.xcodeproj
  • Drag the ProjectCore.xcodeproj to Xcode
  • Add the project as a dependency
  • Link against libProjectCore.a
  • I set it's "Header Search Path" to $(BUILT_PRODUCTS_DIR) which should point to the folder above.

Curiously neither of the approaches work:

#import "ProjectCore.h" // With the (Recursive Flag set for the Headers)
#import <ProjectCore/ProjectCore.h> // The way RestKit does it
Besi
  • 22,579
  • 24
  • 131
  • 223

1 Answers1

4

I suggest using ${TARGET_BUILD_DIR}/ProjectCore in User Header Search Paths - it works for me.

Johnnywho
  • 5,541
  • 2
  • 27
  • 20
  • Can you explain, why you're using "User Header Search Paths" instead of "Header Search Paths"? – Besi Feb 15 '12 at 14:11
  • 3
    Here's good explanation http://stackoverflow.com/questions/3429031/header-search-paths-vs-user-header-search-paths-in-xcode – Johnnywho Feb 15 '12 at 14:13
  • 1
    My problem was actually related to the fact, that the containing project had a configuration `preview` which was not present in the library project and therefore it did not find the headers, since their location is based on the configuration (`Release-iphoneos`). – Besi Feb 17 '12 at 20:01