0

试图添加一个新类别,现在我收到此错误

ProcessPCH /Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/PrecompiledHeaders/tutorial-Prefix-azwowysritanixcinyybieddtusa/tutorial-Prefix.pch.pth tutorial/tutorial-Prefix.pch normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/Home/Developer/tutorial
setenv LANG en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header -arch x86_64 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wduplicate-method-match -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.8 -g -Wno-sign-conversion "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -iquote /Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/tutorial.build/Debug/tutorial.build/tutorial-generated-files.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/tutorial.build/Debug/tutorial.build/tutorial-own-target-headers.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/tutorial.build/Debug/tutorial.build/tutorial-all-target-headers.hmap -iquote /Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/tutorial.build/Debug/tutorial.build/tutorial-project-headers.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Products/Debug/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/tutorial.build/Debug/tutorial.build/DerivedSources/x86_64 -I/Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/tutorial.build/Debug/tutorial.build/DerivedSources -F/Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Products/Debug --serialize-diagnostics /Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/PrecompiledHeaders/tutorial-Prefix-azwowysritanixcinyybieddtusa/tutorial-Prefix.pch.dia -c /Users/Home/Developer/tutorial/tutorial/tutorial-Prefix.pch -o /Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/PrecompiledHeaders/tutorial-Prefix-azwowysritanixcinyybieddtusa/tutorial-Prefix.pch.pth -MMD -MT dependencies -MF /Users/Home/Library/Developer/Xcode/DerivedData/tutorial-dmhshuqgvfykctbdzxopvinwcvpd/Build/Intermediates/PrecompiledHeaders/tutorial-Prefix-azwowysritanixcinyybieddtusa/tutorial-Prefix.pch.d

clang: error: no such file or directory: '/Users/Home/Developer/tutorial/tutorial/tutorial-Prefix.pch'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
4

3 回答 3

0

您的目标似乎是空的,并且您已经错误地删除了前缀文件。

选择您的项目目标(左侧组层次结构顶部的天蓝色图标),选择“目标”下的目标(等于项目名称),然后选择构建阶段标签并将文件添加到编译源。

至于前缀文件,您可能需要重新创建它,它的名称为“YourProjectName-Prefix.pch”。这是我的前缀文件的内容:

#ifdef __OBJC__
    #import <Cocoa/Cocoa.h>
#endif

尝试一下,并考虑如果出现问题并且您没有时间修复它,您可能总是想从头开始构建一个项目。

于 2013-01-09T13:06:19.460 回答
0

您可以执行@Ramy 的建议,也可以简单地Prefix Header从目标构建设置中删除。只需删除该字段的内容,您无法删除实际字段。

目标构建设置

于 2013-01-09T13:12:46.457 回答
0

我收到此错误是因为我不小心给了源文件 -m 标志而不是 -w 标志。这是胖手指。

于 2013-04-02T17:44:41.927 回答