简体   繁体   English

Clang LLVM 1.0错误

[英]Clang LLVM 1.0 Error

Tried to add a new category and now im getting this 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

It seems like your target is empty, and that you have deleted the prefix file for mistake. 看来您的目标是空的,并且您删除了前缀文件是错误的。

Select your project target (the azure icon at the top of the groups hierarchy on the left), select the target (equal to the project name) under "targets", then select the build phases tag and and add files to the compile sources. 选择项目目标(左侧组层次结构顶部的蓝色图标),在“目标”下选择目标(等于项目名称),然后选择构建阶段标签并将文件添加到编译源。

As for the prefix file, you may want to re-create it, it'n names "YourProjectName-Prefix.pch". 至于前缀文件,您可能要重新创建它,其名称为“ YourProjectName-Prefix.pch”。 This is the content of my prefix file: 这是我的前缀文件的内容:

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

Try it, and consider that you may always want to build a project from scratch if something goes wrong and you haven't time to fix it. 尝试一下,并考虑到如果出现问题并且没有时间修复它,您可能总是想从头开始构建项目。

You can either do what @Ramy was suggesting or you can simply remove the Prefix Header from your target build settings. 您可以执行@Ramy的建议,也可以从目标构建设置中删除Prefix Header Simply remove the content of that field, you can't delete the actual field. 只需删除该字段的内容,就不能删除实际的字段。

目标构建设置

I received this error because I accidentally gave a source file a -m flag instead of a -w flag. 我收到此错误是因为我不小心给了源文件-m标志而不是-w标志。 Here's to fat fingers. 这是胖手指。

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

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