简体   繁体   English

Apple LLVM 6.0错误:clang因退出代码-1而失败

[英]Apple LLVM 6.0 Error: clang failed with exit code -1

I created my app on my MacBook Air and kept working with it there which was fine. 我在我的MacBook Air上创建了我的应用程序并继续在那里工作,这很好。 Then I started working with a colleague who used another Mac (of course). 然后我开始与一位使用另一台Mac(当然)的同事合作。 Anyway, we share our Xcode project via Dropbox (we are just switching to BitBucket, don't worry ;) ), when he tried to open the project on his Mac there was a Apple LLVM 6.0 Error with the following error while on my computer the same project runs perfectly: 无论如何,我们通过Dropbox分享我们的Xcode项目(我们只是切换到BitBucket,别担心;)),当他试图在他的Mac上打开项目时,出现了Apple LLVM 6.0 Error ,在我的计算机上出现以下错误同一个项目完美运行:

clang: error: no such file or directory: '/Users/linus/Dropbox/Apps/My App/Projekt/My App/SlideMenu/SlideMenu-Prefix.pch' clang: error: no input files clang:错误:没有这样的文件或目录:'/ Users / linus / Dropbox / Apps / My App / Projekt / My App / SlideMenu / SlideMenu-Prefix.pch'clang:错误:没有输入文件

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

The last lines of the error seem most important to me which is why I listed them here. 错误的最后几行似乎对我来说最重要,这就是为什么我在这里列出它们。

I do know this question was asked several times now but there was never a useful answer which worked for me. 我知道这个问题现在被问了好几次,但从来没有一个有用的答案对我有用。 I tried to disable the Foundation Assertions as it said in another answer on this topic but that did not work. 我试图禁用Foundation Assertions因为它在关于这个主题的另一个答案中说,但是没有用。 Also I restarted & even reinstalled Xcode and all files are existing, none should be missing. 此外,我重新启动甚至重新安装Xcode,所有文件都存在,没有一个应该丢失。

I am running Xcode 6.0.1 and Mac OS X 10.10. 我正在运行Xcode 6.0.1和Mac OS X 10.10。 I hope someone can answer this, I'm kind of desperate now... 我希望有人能回答这个问题,我现在有点绝望了......

Hey I just ran into the same problem. 嘿,我刚遇到同样的问题。 Basically I deleted my tests target. 基本上我删除了我的测试目标。 I found this: 我找到了这个:

Errors When Compiling iOS 8, Xcode 6.0.1 编译iOS 8时的错误,Xcode 6.0.1

Which basically says that: 基本上说:

Click on the name of your project on the list of files/folders on the left in Xcode (at the very top of the list). 在Xcode左侧的文件/文件夹列表中单击项目名称(位于列表的最顶部)。 Look at the "Targets" section on the left-hand side of the window to the right. 查看右侧窗口左侧的“目标”部分。 Likely, there's two listed with the second being a "test" item. 可能,有两个列出,第二个是“测试”项目。 Right-click on that item and select "delete". 右键单击该项目,然后选择“删除”。 Then try to run the project again. 然后尝试再次运行该项目。 See screenshot below for a visual cue. 请参阅下面的屏幕截图以获取视觉提示。

And a picture to help you out: 还有一张照片可以帮到你:

截图 Hope this helps! 希望这可以帮助!

EDIT: Also in the tests target, I actually found that I didn't necessarily need to delete it, there was a broken path, just fixing it makes it all work again. 编辑:同样在tests目标,我实际上发现我不一定需要删除它,有一个破碎的路径,只是修复它使它全部工作。

  1. Make new file: ⌘cmd+N 制作新文件:⌘cmd+ N.
  2. iOS/Mac > Other > PCH File > YourProject-Prefix.pch. iOS / Mac>其他> PCH文件> YourProject-Prefix.pch。
  3. Project > Build Settings > Search: "Prefix Header". 项目>构建设置>搜索:“前缀标题”。
  4. Under "Apple LLVM 6.0" you will get the Prefix Header key 在“Apple LLVM 6.0”下,您将获得Prefix Header密钥
  5. Type in: "YourProjectName/YourProject-Prefix.pch" 输入:“YourProjectName / YourProject-Prefix.pch”
  6. Clean project: ⌘cmd+⇧shift+K 清洁项目:⌘cmd+⇧shift+ K.
  7. Build project: ⌘cmd+B 构建项目:⌘cmd+ B.

Solved this by going to my project settings and changing the deployment target. 通过转到我的项目设置并更改部署目标来解决这个问题。 The deployment target was originally at 7.0. 部署目标最初为7.0。 When i changed it from iOS 8.0 -> 9.1 it works fine and there is no error. 当我从iOS 8.0 - > 9.1更改它时它工作正常,没有错误。

在此输入图像描述

Hope that helps :) 希望有帮助:)

You do not need to delete the overall build settings. 您无需删除整体构建设置。 Just change the Library Search Paths, here are the steps: 只需更改库搜索路径,以下是步骤:

  1. Click on your project name (very top of the navigator) 单击您的项目名称(导航器的顶部)
  2. Click on your project target 单击您的项目目标
  3. Click the tab Build Settings 单击选项卡Build Settings
  4. Search for LIBRARY_SEARCH_PATHS 搜索LIBRARY_SEARCH_PATHS
  5. Change its value to $(inherited) flag. 将其值更改为$(inherited)标志。

Here you go! 干得好!

Or else you can always remove the build setting at all! 或者你总是可以删除构建设置! Cheers! 干杯!

One of the simple things I did I went into "Build Options" and changed the property for Enable Bitcode from yes to no 我做的一件简单的事情我进入了“构建选项”,并将Enable Bitcode的属性从yes更改为no

This fixed my issue. 这解决了我的问题。

Screenshot of Settings 设置截图

clang can't locate your precompiled header file. clang找不到您的预编译头文件。 Have you checked whether there is a file named SlideMenu-Prefix.pch in /Users/linus/Dropbox/Apps/My App/Projekt/My App/ ? 您是否检查过/ Users / linus / Dropbox / Apps / My App / Projekt / My App /中是否有名为SlideMenu-Prefix.pch的文件? The path to the precompiled header file is specified by the "Prefix Header" build setting for your target. 预编译头文件的路径由目标的“前缀头”构建设置指定。

Try, In Xcode project settings, Targets-> Tests section-> Build Settings->Linking remove all linkig 尝试,在Xcode项目设置中,目标 - >测试部分 - >构建设置 - >链接删除所有链接

OR Remove Tests Section as a whole. 或删除测试部分作为一个整体。

Build again and Its done!! 再次建造并完成!!

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

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