Xcode 4 and nested projects — header files not found

来源:互联网 发布:淘宝店装修流程图解 编辑:程序博客网 时间:2024/06/16 06:35

原文:http://stackoverflow.com/questions/5413338/xcode-4-and-nested-projects-header-files-not-found

Forget the whole public header thing with Xcode, it's a PITA and doesn't work correctly when archiving your app. Instead, have all static library header files on the project level and tell your app where to find it.

  1. Ease your pain by making sure all targets have the same name for the build configuration (i.e. add an "AdHoc" and "Deployment" configuration to the static libraries).

  2. In build settings, point the Header Search Paths (if you use #include <file.h>) or User Header Search Paths (if you use #include "file.h") to the directory of the static library project. If the static library project is inside your app directory, use this:

    "$(PROJECT_DIR)" (recursive enabled)

    If you have a directory which contains a) the static library project and b) your app, then this should work:

    "$(PROJECT_DIR)/.." (recursive enabled)

  3. If the submodule contains compiled libraries, set your Library Search Paths to:

    "$(TARGET_BUILD_DIR)"

  4. Make sure all the static library projects that you use have Skip Install set to YES.

  5. Again, no public header files (Build Phases » Copy Headers) in any of the static libraries, otherwise Xcode will not be able to archive an app.

  6. Make sure to tell Xcode when to build the static libraries, as shown in this Tech Doc from Apple.

原创粉丝点击