【问题标题】:clang: error: linker command failed with exit code 1 - library not foundclang:错误:链接器命令失败,退出代码 1 - 找不到库
【发布时间】:2012-03-19 11:58:34
【问题描述】:

我在构建项目时遇到了一点问题。自上周以来,由于某种原因,我收到了以下错误,并且无法摆脱它。

Ld /Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos/SmartPic.app/SmartPic normal armv7
    cd "/Users/Nathan/Documents/Xcode Projects/SmartPic"
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
    setenv 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"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
-L/Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos
-F/Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos -filelist /Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Intermediates/SmartPic.build/Debug-iphoneos/SmartPic.build/Objects-normal/armv7/SmartPic.LinkFileList -dead_strip -miphoneos-version-min=4.3 -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework EventKit -framework EventKitUI -framework MessageUI -lz -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGraphics -framework QuartzCore -framework AVFoundation -framework CoreMedia -framework CoreMotion -framework CoreVideo -framework AudioToolbox -lDMReader -o /Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos/SmartPic.app/SmartPic

ld: library not found for -lDMReader
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我搜索了有关错误的信息,因为在某一时刻,我有 6 个其他类似的,答案是删除构建设置中的库搜索路径,这样就删除了除最后一个之外的所有内容。在我导入一些额外的框架和类之前一切都很好。所以不确定到底是什么原因造成的,以及如何解决。

我对应用程序开发还很陌生,所以请尽量不要技术化。

非常感谢任何帮助,谢谢。

【问题讨论】:

    标签: objective-c xcode clang


    【解决方案1】:

    通过将构建设置中的库搜索路径更改为解决此问题

    ./Classes "$(SRCROOT)/Classes"

    以防万一其他人发现这个并想尝试一下。

    编辑: 补充一下,我刚才又遇到了同样的问题。它发生在我身上的原因是因为我更改了 .xcodeproj 文件所在的文件夹名称。因此,在我的 Mac 上的一个文件夹中,我有一个名为 App Name 的目录和一个名为 App Name.xcodeproj 的文件。我将目录应用程序名称更改为不同的名称,尽管更新了 xcode 中的构建设置,但仍然遇到同样的问题。我必须做的是

    • 右键App Name.xcodeproj
    • 点击Show Package Contents
    • 打开project.pbxproj
    • 然后 cmd + f(搜索)并输入 App Name,我认为只有两个位置,它们位于页面下方的 1/3,称为 name 和紧接着下方,path。将它们更改为新的目录名称,保存并重新打开您的项目,一切都会好起来的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多