简体   繁体   English

Xcode 6:链接器命令失败,退出代码为1

[英]Xcode 6: linker command failed with exit code 1

I just accidentally deleted a framework but I can't figure out which one it is, nor do I know if adding it back will simply solve the problem. 我只是不小心删除了一个框架,但无法弄清楚它是哪个框架,也不知道将其重新添加是否可以解决问题。 This is the error message that I'm getting: 这是我收到的错误消息:

ld: cannot link directly with /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/usr/lib/system/libdyld.dylib. ld:无法直接与/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/usr/lib/system/libdyld.dylib链接。 Link against the umbrella framework 'System.framework' instead. 链接到伞形框架“ System.framework”。 for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 对于体系结构i386 clang:错误: 链接器命令失败,退出代码为1(使用-v查看调用)

Any help would be greatly appreciated! 任何帮助将不胜感激! I'm sure theres a simple solution, I just cannot figure it our for the life of me! 我敢肯定,有一个简单的解决方案,我无法一生解决它!

Thanks! 谢谢!

It sounds like you've linked directly against libdyld.dylib which isn't necessary as it's part of one of the core frameworks. 听起来您好像已经直接链接到libdyld.dylib ,这不是必需的,因为它是核心框架之一。 Remove it and it should compile fine without it. 删除它,没有它,它应该可以正常编译。

Source control is the simple solution. 源代码管理是简单的解决方案。 You'd be able to diff your project to see what (framework) changed, or revert it to an earlier (working) state. 您可以比较您的项目以查看更改的内容(框架),或将其恢复为较早的(工作)状态。

If you aren't using source control (you didn't check the 'Use Git' box when you created your project), here's how to start using it with your existing project. 如果您不使用源代码管理(在创建项目时未选中“使用Git”框),那么下面介绍了如何在现有项目中使用它。

Open up a terminal window, and cd to the project directory -- it's the one with the ProjectName .xcodeproj directory. 打开一个终端窗口,并cd到项目目录-这是一个具有ProjectName .xcodeproj目录的目录。 Once there, type: 在那里,输入:

git init
git add .
git commit -m "Initial commit"

Restart Xcode. 重新启动Xcode。 The repository will now be visible in Xcode, and you can commit or discard changes via the project navigator, and compare revisions via the Version editor. 现在,该存储库将在Xcode中可见,您可以通过项目导航器提交或放弃更改,并通过版本编辑器比较修订。

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

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