繁体   English   中英

Clang LLVM 1.0错误

[英]Clang LLVM 1.0 Error

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

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

看来您的目标是空的,并且您删除了前缀文件是错误的。

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

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

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

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

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

目标构建设置

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM