Xcode 4 无法从静态库依赖项中找到公共头文件 [英] Xcode 4 can't locate public header files from static library dependency
问题描述
辅助搜索的替代标题
- Xcode 找不到标题
- Xcode 中缺少 .h
- 未找到 Xcode .h 文件
- 找不到词法或预处理器问题文件
我正在开发一个来自 Xcode 3 的 iOS 应用程序项目.我现在已经转移到 Xcode 4,我的项目构建了许多静态库.
这些静态库还声明公共头文件,并且这些头文件由应用程序代码使用.在 Xcode 3.x 中,标头被复制(作为构建阶段)到 public headers directory
,然后在应用程序项目中 public headers directory
被添加到 标题搜索列表
.
在 Xcode 4 下,构建目录移动到 ~/Library/Developer/Xcode/DerivedData/my-project
.
问题是如何在标题搜索设置中引用这个新位置?看来:
public headers directory
是相对于DerivedData
目录的,但是headers search
目录相对于其他东西(可能是项目位置)
我应该如何在 Xcode 4 中为 iOS 开发设置一个静态库目标,以确保在尝试编译为依赖项时使用静态库的客户端可以使用头文件?
Xcode 4 项目编译静态库失败
<块引用>相关问题:词法或预处理器问题文件在 Xcode 4 中找不到"
错误可能包括:缺少头文件、词法或预处理器问题"
解决方案:
- 检查用户标头路径";是正确的
- 设置始终搜索用户路径"是的
- 创建群呼索引标头"在您的项目中并将标题拖到该组中,请勿在出现提示时添加到任何目标.
Alternate titles to aid search
- Xcode can't find header
- Missing .h in Xcode
- Xcode .h file not found
- lexical or preprocessor issue file not found
I'm working on an iOS application project which came from Xcode 3. I have now moved to Xcode 4 my project builds a number of static libraries.
Those static libraries also declare public headers and those headers are used by the application code. In Xcode 3.x the headers were copied (as a build phase) to the public headers directory
, then in the application project the public headers directory
was added to the headers search list
.
Under Xcode 4 the build directory is moved to ~/Library/Developer/Xcode/DerivedData/my-project
.
The problem is how do I reference this new location in the headers search settings? It seems that:
public headers directory
is relative toDerivedData
directory, butheaders search
directory is relative to something else (possibly the project location)
How should I set up a static library target for iOS development in Xcode 4 that will ensure the header files are made available to the clients that use the static library when trying to compile as a dependancy?
Xcode 4 Project Fails to compile a static library
Related question: "lexical or preprocessor issue file not found " in Xcode 4
Errors might include; missing header files, "lexical or preprocessor issue"
Solutions:
- Check the "user header paths" are correct
- Set "Always search user paths" to YES
- Create a group call "Indexing headers" in your project and drag the headers to this group, DO NOT add to any targets when prompted.
这篇关于Xcode 4 无法从静态库依赖项中找到公共头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!