ios 苹果 LLVM 6.0 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24052293/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Apple LLVM 6.0 Error
提问by Atif Imran
I recently downloaded and installed the XCode6-Beta and I am getting this build error. Steps already taken:
我最近下载并安装了 XCode6-Beta,但出现此构建错误。已经采取的步骤:
- Double checked my prefix header file.
- Cleaned project.
- Restarted XCode.
- Deleted DerivedData like 100 times!
- 仔细检查了我的前缀头文件。
- 清理项目。
- 重新启动 XCode。
- 删除了 100 次 DerivedData!
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 支持,这是导致问题的领域之一,但是,如果您需要对早期版本的支持,这仍然是一个问题。
回答by user4059661
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
-> 启用基金会断言将其设置为否
回答by NHDaly
The problem is, Xcode is not telling you the actual error that clang (LLVM) is throwing; it's just saying that clang
process exited with code 1, meaning an error.
问题是,Xcode 没有告诉您 clang (LLVM) 抛出的实际错误;它只是说该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. Clicking on the three lines on the side will bring up the full command that was run and the output it gave.
如果您打开“日志导航器”(View-->Navigators-->Logs Navigator
或cmd-8
)并单击“构建”,您应该能够看到刚刚运行的构建。单击侧面的三行将显示运行的完整命令及其给出的输出。
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
cd /Users/Daly/Documents/School/EECS/Labs/Misc/Misc
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 -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/Intermediates/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
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.com64 normal x++ .apple.compilers.llvm.clang.1_0.compiler
cd /Users/Daly/Documents/School/EECS/Labs/Misc/Misc
导出 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。平台/开发人员/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-hbomdgtflyhkesv 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/调试/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/Intermediates/Misc.build/Debug/Misc.build/DerivedSources/x86_64 -I/Users/Daly/Library/Developer/Xcode/Derived Misc-hbomxnscgtjodqafsvgpndlyhkes/Build/Intermediates/Misc.build/Debug/Misc.build/DerivedSources -F/Users/Daly/Library/Developer/Xcode/DerivedData/Misc-hbomxnscgtjodqafsvgpndlyhkes/BuildD /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_Users.dia -c / /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/Debug/Misc .build/Objects-normal/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)!
希望这能让您看到错误,我们可以从那里开始工作(可能在一个新问题中)!
回答by Beto Caldas
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.
当我重命名我的项目时,这发生在我身上。要解决此问题,请选择 Targets/Build Settings 并搜索旧项目名称并替换为新名称。
回答by Ghean
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
我遇到了同样的错误,但导致它丢失的是一些类库。然后我再次将它们添加到项目中,但仍然导致错误。
在构建阶段搜索后,那些丢失的类仍然链接到项目,所以我所做的就是删除那些突出显示为红色的类。
清理项目,然后构建它。
对我来说,它奏效了
回答by LinusGeffarth
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
回答by LinusGeffarth
This exampleworked 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
STEP 2:The new window will open, copy the derived data address till /derivedData
e.g. ~/Library/Developer/Xcode/DerivedData/
STEP 3:Quit xCode
STEP 4:Double click/tap on finder and select "Go to Folder"
STEP 5:Paste the copied address in the text field
STEP 6:The folder that will open delete every single file and folder you see in it.
STEP 7:Empty your trash and open xCode again and run the project.
It worked for me.
这个例子对我有用。如果您想使用屏幕截图进行操作,请点击此链接。否则这里是步骤:
步骤 1:从 xcode 的菜单栏中选择 > 窗口 > 管理器
步骤 2:将打开新窗口,复制派生数据地址,直到/derivedData
例如~/Library/Developer/Xcode/DerivedData/
步骤 3:退出 xCode
步骤 4:双击/点击查找器并选择“转到文件夹”
步骤 5:在文本字段中粘贴复制的地址
步骤 6:将打开的文件夹删除您在其中看到的每个文件和文件夹。
步骤 7:清空垃圾箱并再次打开 xCode 并运行项目。
它对我有用。
回答by Atif Imran
Temporary Solution.
临时解决方案。
I removed the 6.0 support which was one of the areas causing problem and that seemed to have fixed it. However, if you need support for earlier versions this will still be an issue.
我删除了 6.0 支持,这是导致问题的领域之一,并且似乎已经修复了它。但是,如果您需要对早期版本的支持,这仍然是一个问题。
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. If you dont't need the pre-compilation set it to NO by going to TARGETS > PreCompile Prefix Headersand selecting NO. You may then need to manually import the frameworks/file to every class file you make.
prefix.pch 文件可能有问题,请确保您还仔细检查了您的 prefix.pch 是否有任何可能来自先前操作系统版本的代码。如果您不需要预编译,则通过转到TARGETS > PreCompile Prefix Headers并选择 NO将其设置为NO。然后,您可能需要手动将框架/文件导入到您制作的每个类文件中。
EDIT
编辑
If you do a hard cleaning cmd + product > clean. You will see an option '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)
如果您进行硬清洁 cmd + product > clean。您将看到一个选项“清理构建文件夹...”。使用它有时会消除问题。如果这仍然不起作用,重新安装 xcode6 它将起作用(因为您已经下载了 dmg 设置,只需要 2 分钟)
回答by ViperMav
I was able to resolve this error by changing the 'Build Settings -> iOS Deployment Target' value to a more recent iOS version.
我能够通过将“构建设置 -> iOS 部署目标”值更改为更新的 iOS 版本来解决此错误。
回答by Spandan
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
在构建设置> 构建选项> 启用索引时构建功能为否