这个问题在过去几周内已经发展,以涵盖xcode4的更多一般性问题(以及从旧的xcode升级项目).
然而,许多问题可以通过遵循相同的指令集来解决.
如果您遇到以下任何问题,请尝试接受的答案中的方法:
标题: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.
Run Code Online (Sandbox Code Playgroud)
Xcode给出了错误
lexical or preprocessor issue file not found
Run Code Online (Sandbox Code Playgroud)
很多谷歌搜索显示很多人都有这个问题,但没有解决方案.任何人都得到了修复甚至线索.
更新:在user header搜索路径设置为${BUILT_PRODUCTS_DIR}所有配置.除了归档时,它使用任何配置构建良好.
更新2: Merchant.h …
compiler-construction objective-c clang xcode4 c-preprocessor
替代标题以帮助搜索
- Xcode找不到标题
- 在Xcode中缺少.h
- 找不到Xcode .h文件
- 未找到词法或预处理器问题文件
我正在开发一个来自Xcode 3的iOS应用程序项目.我现在已经转移到Xcode 4,我的项目构建了许多静态库.
这些静态库还声明了公共头文件,这些头文件由应用程序代码使用.在Xcode 3.x中,标题被复制(作为构建阶段)public headers directory,然后在应用程序项目中public headers directory被添加到headers search list.
在Xcode 4下,构建目录被移动到~/Library/Developer/Xcode/DerivedData/my-project.
问题是我如何在标题搜索设置中引用这个新位置?看起来:
public headers directory是相对于DerivedData目录,但是headers search 目录是相对于其他东西(可能是项目位置)我应该如何在Xcode 4中为iOS开发设置静态库目标,以确保在尝试编译为依赖项时,使用静态库的客户端可以使用头文件?