简体   繁体   English

Apple LLVM 6.0错误

[英]Apple LLVM 6.0 Error

I recently downloaded and installed the XCode6-Beta and I am getting this build error. 我最近下载并安装了XCode6-Beta,我收到了这个构建错误。 Steps already taken: 已采取的步骤:

  1. Double checked my prefix header file. 双重检查我的前缀头文件。
  2. Cleaned project. 清理项目。
  3. Restarted XCode. 重新启动XCode。
  4. Deleted DerivedData like 100 times! 删除衍生数据100次!

Any thing I may be missing? 我可能会遗失任何东西?

Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1 命令/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang失败,退出代码为1

EDIT: Temporary Solution. 编辑:临时解决方案。

I removed the 6.0 support which was one of the areas causing problem however, if you need support for earlier versions this will still be an issue. 我删除了6.0支持,这是导致问题的区域之一,但如果您需要支持早期版本,这仍然是一个问题。

Ther is one way! 这是一种方式!

Select Targets/Build Settings/ Scroll to Apple LLVM 6.0 - Preprocessing 选择目标/构建设置/滚动到Apple LLVM 6.0 - 预处理

-> ENABLE FOUNDATION ASSERTIONS set it to NO - > ENABLE FOUNDATION ASSERTIONS将其设置为NO

The problem is, Xcode is not telling you the actual error that clang (LLVM) is throwing; 问题是,Xcode没有告诉你clang(LLVM)正在抛出的实际错误; it's just saying that clang process exited with code 1, meaning an error. 它只是说clang进程退出代码1,意味着错误。

To find out exactly what the error is requires a bit of digging... 要准确找出错误是什么需要一点挖掘......

I don't have Xcode6, but this how it can be done in Xcode 5, and it's probably pretty similar: 我没有Xcode6,但这可以在Xcode 5中完成,它可能非常相似:


If you open the "Logs Navigator" ( View-->Navigators-->Logs Navigator or cmd-8 ) and click on "Build", you should be able to see the build that you just ran. 如果打开“Logs Navigator”( View-->Navigators-->Logs Navigatorcmd-8 )并单击“Build”,您应该能够看到刚刚运行的构建。 Clicking on the three lines on the side will bring up the full command that was run and the output it gave. 单击侧面的三行将显示已运行的完整命令及其给出的输出。

You might be able to see your error here, but if not, you can do one better: 你可能会在这里看到你的错误,但如果没有,你可以做得更好:

Copy and paste the command (it will be HUGE) from the window into a terminal and run it! 将命令(它将是巨大的)从窗口复制并粘贴到终端并运行它! You should look something like this: 你应该看起来像这样:

CompileC /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.o Misc/template_tests.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.o Misc / template_tests.cpp正常x86_64 c ++ com .apple.compilers.llvm.clang.1_0.compiler

cd /Users/Daly/Documents/School/EECS/Labs/Misc/Misc cd / Users / Daly / Documents / School / EECS / Labs / Misc / Misc

export LANG=en_US.US-ASCII export LANG = en_US.US-ASCII

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wmissing-prototypes -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.8 - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c ++ -arch x86_64 -fmessage-length = 0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit = 0 -std = c ++ 11 -stdlib = libc ++ -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wmissing-prototypes -Wno-non-virtual-dtor -Wno-overloaded-virtual - Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body - Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion - Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c ++ 11-extensions -DDEBUG = 1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /MacOSX10.9.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min = 10.8 - g -fvisibility-inlines-hidden -Wno-sign-conversion -iquote /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-generated-files.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-own-target-headers.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-all-target-headers.hmap -iquote /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-project-headers.hmap -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Products/Debug/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Int g -fvisibility-inlines-hidden -Wno-sign-conversion -iquote /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Misc-generated- files.hmap -I / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Intermediates / Misc.build / Debug / Misc.build / Misc-own-target-headers.hmap -I / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Intermediates / Misc.build / Debug / Misc.build / Misc-all-target-headers.hmap -iquote / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Intermediates / Misc.build / Debug / Misc.build / Misc-project-headers.hmap -I / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Products / Debug / include -I / Applications / Xcode.app / Contents / Developer / Toolchains / XcodeDefault.xctoolchain / usr / include -I / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Int ermediates/Misc.build/Debug/Misc.build/DerivedSources/x86_64 -I/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/DerivedSources -F/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Products/Debug -MMD -MT dependencies -MF /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.d --serialize-diagnostics /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.dia -c /Users/Daly/Documents/School/EECS/Labs/Misc/Misc/Misc/template_tests.cpp -o /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.o ermediates / Misc.build / Debug / Misc.build / DerivedSources / x86_64 -I / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Intermediates / Misc.build / Debug / Misc.build / DerivedSources - F / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Products / Debug -MMD -MT dependencies -MF / Users / Daly / Library / Developer / Xcode / DerivedData / Misc-hbomxnscgtjodqafsvgpndlyhkes / Build / Intermediates /Misc.build/Debug/Misc.build/Objects-normal/x86_64/template_tests.d-serialize- diagnostics /Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/ Debug / Misc.build / Objects-normal / x86_64 / template_tests.dia -c /Users/Daly/Documents/School/EECS/Labs/Misc/Misc/Misc/template_tests.cpp -o / Users / Daly / Library / Developer /的xcode / DerivedData /杂项-hbomxnscgtjodqafsvgpndlyhkes /建造/中间体/ Misc.build /调试/ Misc.build /对象 - 正常/ x86_64的/ template_tests.o

(This is from one of my projects.) You can skip the first line ( CompileC .... 1_0.compiler ), but copy the rest and paste it into a terminal! (这是我的一个项目。)你可以跳过第一行( CompileC .... 1_0.compiler ),但复制其余部分并将其粘贴到终端!

Hopefully this lets you see the error and we can work from there (probably in a new question)! 希望这可以让你看到错误,我们可以从那里工作(可能在一个新的问题)!

This happened to me when I renamed my project. 当我重命名我的项目时,这发生在我身上。 To solve this, Select Targets/Build Settings and search for the old project name and replace with the new name. 要解决此问题,请选择“目标/构建设置”并搜索旧项目名称并替换为新名称。

I got the same error, but what causing it was some missing classes library. 我得到了同样的错误,但是导致它的原因是一些缺少的类库。 then i added them again to the project but still causing the error. 然后我再次将它们添加到项目中但仍然导致错误。
after i searched it in the build phase, those class that had been missing is still linked to the project, so all i did is to remove those class that been highlighted red. 在我在构建阶段搜索它之后,那些丢失的类仍然链接到项目,所以我所做的就是删除那些突出显示为红色的类。
clean the project, and then build it. 清理项目,然后构建它。
for me, it worked 对我来说,它奏效了

Final solution: 最终解决方案

Try to delete the appTests like here here: 尝试删除这里的appTests:

https://www.dropbox.com/s/j9s6nycb58x3nzs/target_tests.png?dl=0 https://www.dropbox.com/s/j9s6nycb58x3nzs/target_tests.png?dl=0

Credits for this answer: Apple LLVM 6.0 Error: clang failed with exit code -1 这个答案的功劳: Apple LLVM 6.0错误:clang因退出代码-1而失败

This example worked for me. 这个例子对我有用。 Follow this link if you want to do it with the screen shots. 如果您想使用屏幕截图,请点击此链接。 Otherwise here are the steps: 否则以下是步骤:
STEP 1: From the menu bar of xcode select > window > organizer 第1从xcode的菜单栏中选择>窗口>管理器
STEP 2: The new window will open, copy the derived data address till /derivedData eg ~/Library/Developer/Xcode/DerivedData/ 第2 /derivedData 新窗口打开,复制派生数据地址直到/derivedData例如~/Library/Developer/Xcode/DerivedData/
STEP 3: Quit xCode 第3退出xCode
STEP 4: Double click/tap on finder and select "Go to Folder" 第4步:双击/点击查找器并选择“转到文件夹”
STEP 5: Paste the copied address in the text field 步骤5:将复制的地址粘贴到文本字段中
STEP 6: The folder that will open delete every single file and folder you see in it. 第6步:将打开的文件夹删除您在其中看到的每个文件和文件夹。
STEP 7: Empty your trash and open xCode again and run the project. 步骤7:清空垃圾箱并再次打开xCode并运行该项目。
It worked for me. 它对我有用。

Temporary Solution. 临时解决方案。

I removed the 6.0 support which was one of the areas causing problem and that seemed to have fixed it. 我删除了6.0支持,这是导致问题的区域之一,似乎已修复它。 However, if you need support for earlier versions this will still be an issue. 但是,如果您需要早期版本的支持,这仍然是一个问题。

There might be trouble at the prefix.pch file, make sure you also double check your prefix.pch for any code that might be from the previous os version. 在prefix.pch文件中可能有问题,请确保您还可以检查您的prefix.pch以查找可能来自先前操作系统版本的任何代码。 If you dont't need the pre-compilation set it to NO by going to TARGETS > PreCompile Prefix Headers and selecting NO. 如果您不需要预编译,请转到TARGETS> PreCompile Prefix Headers并选择NO。 You may then need to manually import the frameworks/file to every class file you make. 然后,您可能需要手动将框架/文件导入到您创建的每个类文件中。

EDIT 编辑

If you do a hard cleaning cmd + product > clean. 如果你做一个硬清洁cmd +产品>清洁。 You will see an option 'Clean Build Folder..'. 您将看到一个选项'Clean Build Folder ..'。 Using that sometimes removes the issue. 使用它有时可以解决问题。 If that still doesn't work reinstall the xcode6 and it will work(since you already have the downloaded dmg setup, it will take 2min only) 如果仍然无法重新安装xcode6,它将工作(因为你已经有下载的dmg设置,它将只需要2分钟)

我能够通过将“构建设置 - > iOS部署目标”值更改为更新的iOS版本来解决此错误。

I was trying to use openMP on XCode-9 on Mac-OS Sierra 10.13.4 and I followed these steps : [ http://antonmenshov.com/2017/09/09/clang-openmp-setup-in-xcode/][1] 我试图在Mac-OS Sierra 10.13.4上的XCode-9上使用openMP,我按照以下步骤操作:[ http://antonmenshov.com/2017/09/09/clang-openmp-setup-in-xcode/] [1]

I have the error like this : 我有这样的错误:

clang-6.0: error: cannot specify -o when generating multiple output files clang-6.0:错误:生成多个输出文件时无法指定-o

I fix that problem by changing some settings in XCode: 我通过更改XCode中的一些设置来解决该问题:

In build settings > build options > Enable Index-While-Building Functionality to No 在构建设置>构建选项>启用索引 - 构建时功能为否

This problem might occur when the project library looses its reference due to some condition.Go to --> Library -->Developer --> Xcode -->DerivedData .Now delete the "DerivedData" folder.Clean and run your project. 由于某些条件,项目库失去其引用时可能会出现此问题。转到 - >库 - >开发人员 - > Xcode - > DerivedData。现在删除“DerivedData”文件夹。清理并运行您的项目。 This solves the issue. 这解决了这个问题。 Hope this helps 希望这可以帮助

Such a problem may occur if you change some Cocoa header by an accident. 如果您因意外更改某些Cocoa标头,则可能会出现此类问题。 The compiler will ask you to rebuild precompiled headers (in my case it did so), but the actual error will be different. 编译器会要求您重建预编译的头文件(在我的例子中它会这样做),但实际的错误会有所不同。 To make the compiler show you a real error set ENABLE FOUNDATION ASSERTIONS to NO (it's described above), so, you'll find out which header caused failure. 为了使编译器显示真正的错误,将ENABLE FOUNDATION ASSERTIONS设置为NO (如上所述),因此,您将找出导致失败的标头。

You need to change the Development target .... it works for me 您需要更改Development target ....它适用于我

在此输入图像描述

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

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