因此,我想使用终端中的xcodebuild从测试应用程序(称为RunTeszt2)创建构建。该应用程序是一个iOS单视图应用程序,没有任何内容,只是创建和关闭。
当我从终端尝试时,构建失败.
xcodebuild -target "RunTeszt2" -sdk "$iphoneos5" -configuration Debug
错误是:
/Users/toodygarik/Desktop/RunTeszt2/RunTeszt2/RunTeszt2-Prefix.pch:12:13: fatal error: 'UIKit/UIKit.h' file not found #import <UIKit/UIKit.h>
The following build commands failed:
ProcessPCH /var/folders/6s/cjw35hhs5lb6wpnx9m8lr2km0000gn/C/com.apple.Xcode.501
/SharedPrecompiledHeaders/RunTeszt2-Prefix-bxwegbsdjylasccydwchfkbjadur/
RunTeszt2-Prefix.pch.pth RunTeszt2/RunTeszt2-Prefix.pch normal i386 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
当我从XCode (4.5)运行这个应用程序时,构建完成了,一切正常。在从console.app运行应用程序时,我检查了XCode日志,它没有显示上面的错误消息。
是什么引起了这个问题?
编辑:基于H2CO3
**'s注释的,我编辑了项目构建设置的其他C标志条目,如下所示:**
-isysroot $SDKROOT
..。现在这个问题已经解决了。我又回到了另一个与issue构建相关的问题:iOS: XCode 4.4.1: xcodebuild error - Unable to read diagnostics from file
谢谢,H2CO3
!
发布于 2012-09-21 13:24:06
您必须指定您要获取的特定操作系统的开发sysroot,否则编译器和链接器无法找到标头和库。将-isysroot <SYSROOT>
添加到编译器和链接器标志中,其中SYSROOT
应该是iPhoneOSXXX.sdk
目录的完整路径(XXX是iOS的版本号)。
https://stackoverflow.com/questions/12529700
复制相似问题