这个问题在过去几周逐渐演变成更一般的与xcode4相关的问题(以及从旧版xcode升级项目)。
然而,许多问题可以通过遵循相同的指令来解决。
如果你有以下任何问题,请尝试接受答案中的方法:
- Xcode 4无法归档应用程序
- Xcode 4创建了一个无法使用的存档
- Xcode 4未创建.ipa文件
- Xcode 4由于预处理器错误而无法编译
- Xcode 4找不到头文件
- Xcode 4的代码完成功能不起作用
- 项目依赖项无法编译
- 添加依赖项会导致上述任何问题
原始问题
标题:"lexical or preprocessor issue file not found" in 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
许多人在Google中搜索后发现这个问题,但没有解决方案。有人有修复或线索吗?
更新:在所有配置中,用户头文件
搜索路径设置为${BUILT_PRODUCTS_DIR}
。使用任何配置都可以正常构建,除了存档。
更新2:Merchant.h
是一个自动生成的Core Data类,因此在.xcdatamodeld
包内,但是当库被构建时,所有头文件都会被复制到公共头文件目录中。