【发布时间】:2011-07-31 20:33:45
【问题描述】:
这个问题在过去几周内已经演变为涵盖xcode4 的更一般性问题(以及从旧的xcodes 升级项目)。
但是,许多问题可以通过遵循相同的说明来解决。
如果您有以下任何问题,请尝试接受答案中的方法:
- Xcode 4 无法归档应用程序
- Xcode 4 创建了一个无法使用的存档
- Xcode 4 不会创建 .ipa
- Xcode 4 由于预处理器错误而无法编译
- Xcode 4 找不到标头
- Xcode 4 的代码完成不工作
- 项目依赖项无法编译
- 添加依赖项会导致上述任何问题
原始问题
标题:Xcode 4 中的“词法或预处理器问题文件未找到”
我在 Xcode 4 中有一个项目,可以正常构建并在设备和模拟器上运行,但是在查找与静态库关联的头文件时尝试存档时出错:
In file included from /Volumes/Development/Path/LBProject/LBProject/LBProject-Prefix.pch:15:
In file included from /Volumes/Development/Path/LBProject/LBFDefines.h:23:
In file included from /Volumes/Development/Path/LBProject/Classes/LBProjectAppDelegate.h:11:
In file included from /Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDirectoryManager.h:10:
/Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDataModel.h:11:9: fatal error: 'Merchant.h' file not found [1]
#import "Merchant.h"
^
1 error generated.
Xcode 报错
lexical or preprocessor issue file not found
Much 谷歌搜索显示很多人都遇到了这个问题,但没有解决方案。任何人都得到了修复甚至线索。
更新:user header 搜索路径在所有配置中都设置为 ${BUILT_PRODUCTS_DIR}。除了存档时,它使用任何配置都可以很好地构建。
更新 2: Merchant.h 是一个自动生成的 Core Data 类,因此在 .xcdatamodeld 包中,但是在构建库时,所有头文件都复制到公共头文件目录.
【问题讨论】:
标签: xcode4 xcode objective-c compiler-construction xcode4 clang c-preprocessor