ios - ld : file not found: linker command failed w

我在 Xcode 中构建项目时遇到以下错误:

ld: file not found

/Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Products/Debug-iphoneos/Social_Events.app/Social_Events clang: error: linker command failed with exit code 1 (use -v to see invocation)

在过去的一个小时里,我一直遇到这个错误。有什么解决方案吗? 代码在 iOS 7xCode 5.0 中运行良好。现在对于 iOS8 它给了我这个错误。

使用框架:

  • 核心电话
  • map 包
  • Facebook.SDK v3.20
  • 基金会
  • 核心图形
  • UIKit 框架

完全错误:

<pre>
Ld /Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Intermediates/Social_Events.build/Debug-iphoneos/Social_EventsTests.build/Objects-normal/arm64/Social_EventsTests normal arm64
    cd /Users/MacBookPro/Desktop/Social_Events/Social_Events/Social_Events
    export IPHONEOS_DEPLOYMENT_TARGET=7.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
</pre>

>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Products/Debug-iphoneos -F/Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/Developer/Library/Frameworks -filelist /Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Intermediates/Social_Events.build/Debug-iphoneos/Social_EventsTests.build/Objects-normal/arm64/Social_EventsTests.LinkFileList -dead_strip -bundle_loader /Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Products/Debug-iphoneos/Social_Events.app/Social_Events -framework XCTest -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.1 -framework XCTest -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Intermediates/Social_Events.build/Debug-iphoneos/Social_EventsTests.build/Objects-normal/arm64/Social_EventsTests_dependency_info.dat -o /Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Intermediates/Social_Events.build/Debug-iphoneos/Social_EventsTests.build/Objects-normal/arm64/Social_EventsTests

>ld: file not found: /Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Products/Debug-iphoneos/Social_Events.app/Social_Events
clang: error: linker command failed with exit code 1 (use -v to see invocation)

>(null): File not found: /Users/MacBookPro/Library/Developer/Xcode/DerivedData/Social_Events-cfnteabiivwfdzcoulzznhmgobhy/Build/Products/Debug-iphoneos/Social_Events.app/Social_Events

最佳答案

您可能会收到此错误,因为您重命名了项目并且无法再找到 Tests。这很容易解决:

像这样在 Xcode 中解决它:

  1. 从项目导航器中选择您的项目。
  2. 在目标下选择[Your project's Tests]
  3. General 选项卡下,从下拉列表中更改 Host Application
  4. 构建并运行。

这个问题发生在我身上,因为我重命名了我的项目并且测试找不到它了。

关于ios - ld : file not found: linker command failed with exit code 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26665196/

相关文章:

iphone - 如何在 UITextView 中设置边距(填充)?

iphone - HTML 内容适合 UIWebview 而无需缩小

iphone - 如何设置字体大小以填充 UILabel 高度?

objective-c - 如何在 Objective-C 中调用方法?

ios - UIButton 底部阴影

iphone - 将数据传回前一个 View Controller

objective-c - 将 UIColor 保存到 NSUserDefaults 并从中加载

iphone - 如何阻止 NSNotification 中的观察者调用两次?

objective-c - 反转 NSString 文本

iphone - AdMob 崩溃并显示 [GADObjectPrivate changeState