ios Apple LLVM 6.0 错误:clang 失败,退出代码为 -1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26772504/
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: clang failed with exit code -1
提问by LinusGeffarth
I created my app on my MacBook Air and kept working with it there which was fine. Then I started working with a colleague who used another Mac (of course). 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:
我在我的 MacBook Air 上创建了我的应用程序,并在那里继续使用它,这很好。然后我开始与一位使用另一台 Mac 的同事合作(当然)。无论如何,我们通过 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
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
clang:错误:没有这样的文件或目录:'/Users/linus/Dropbox/Apps/My App/Projekt/My App/SlideMenu/SlideMenu-Prefix.pch' clang:错误:没有输入文件
命令 /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. Also I restarted & even reinstalled Xcode and all files are existing, none should be missing.
我知道这个问题现在已经被问过好几次了,但从来没有一个有用的答案对我有用。我试图禁用Foundation Assertions
它在关于这个主题的另一个答案中所说的,但这没有用。我也重新启动甚至重新安装了 Xcode 并且所有文件都存在,不应该丢失任何文件。
I am running Xcode 6.0.1 and Mac OS X 10.10. I hope someone can answer this, I'm kind of desperate now...
我正在运行 Xcode 6.0.1 和 Mac OS X 10.10。我希望有人能回答这个问题,我现在有点绝望……
回答by jalagrange
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
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). 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.
在 Xcode 左侧的文件/文件夹列表中单击您的项目名称(在列表的最顶部)。查看右侧窗口左侧的“目标”部分。可能列出了两个,第二个是“测试”项目。右键单击该项目并选择“删除”。然后尝试再次运行该项目。有关视觉提示,请参见下面的屏幕截图。
And a picture to help you out:
还有一张图片可以帮助你:
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
目标中,我实际上发现我不一定需要删除它,有一个损坏的路径,只需修复它就可以让它再次工作。
回答by Zverusha
- Make new file: ?cmd+N
- iOS/Mac > Other > PCH File > YourProject-Prefix.pch.
- Project > Build Settings > Search: "Prefix Header".
- Under "Apple LLVM 6.0" you will get the Prefix Header key
- Type in: "YourProjectName/YourProject-Prefix.pch"
- Clean project: ?cmd+?shift+K
- Build project: ?cmd+B
- 新建文件:?cmd+N
- iOS/Mac > 其他 > PCH 文件 > YourProject-Prefix.pch。
- 项目 > 构建设置 > 搜索:“前缀标题”。
- 在“Apple LLVM 6.0”下,您将获得 Prefix Header 键
- 输入:“YourProjectName/YourProject-Prefix.pch”
- 清理项目:?cmd+?shift+K
- 构建项目:?cmd+B
回答by Lukesivi
回答by Juan Arreguín
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
fromyes
到no
This fixed my issue.
这解决了我的问题。
回答by Rizwan Awan
You do not need to delete the overall build settings. Just change the Library Search Paths, here are the steps:
您不需要删除整体构建设置。只需更改库搜索路径,步骤如下:
- Click on your project name (very top of the navigator)
- Click on your project target
- Click the tab
Build Settings
- Search for
LIBRARY_SEARCH_PATHS
- Change its value to
$(inherited)
flag.
- 单击您的项目名称(导航器的最顶部)
- 单击您的项目目标
- 单击选项卡
Build Settings
- 搜索
LIBRARY_SEARCH_PATHS
- 将其值更改为
$(inherited)
flag。
Here you go!
干得好!
Or else you can always remove the build setting at all! Cheers!
否则,您始终可以完全删除构建设置!干杯!
回答by Dex
clang can't locate your precompiled header file. Have you checked whether there is a file named SlideMenu-Prefix.pch in /Users/linus/Dropbox/Apps/My App/Projekt/My App/ ? The path to the precompiled header file is specified by the "Prefix Header" build setting for your target.
clang 无法找到您的预编译头文件。您是否检查过 /Users/linus/Dropbox/Apps/My App/Projekt/My App/ 中是否有名为 SlideMenu-Prefix.pch 的文件?预编译头文件的路径由目标的“前缀头”构建设置指定。
回答by Vinod Supnekar
Try, In Xcode project settings, Targets-> Tests section-> Build Settings->Linking remove all linkig
尝试,在 Xcode 项目设置中,Targets-> Tests section-> Build Settings->Linking remove all linkig
OR Remove Tests Section as a whole.
或 删除整个测试部分。
Build again and Its done!!
再次构建并完成!