【问题标题】:Unable to link ALAssetsLibrary无法链接 ALAssetsLibrary
【发布时间】:2012-06-23 20:10:06
【问题描述】:

我正在努力在我的代码中链接 ALAssetsLibrary。

我对此进行了很多谷歌搜索,并遵循了不止一个教程到最后一个点,但我仍然是我开始的地方。

Ld /Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator/PickThumb.app/PickThumb normal i386
    cd "/Users/vedprakash/Documents/XCode Projects/PickThumb"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator -F/Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator -filelist /Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Intermediates/PickThumb.build/Debug-iphonesimulator/PickThumb.build/Objects-normal/i386/PickThumb.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/vedprakash/Library/Developer/Xcode/DerivedData/PickThumb-gmvprlkgmgexedeojbaoeidbadnw/Build/Products/Debug-iphonesimulator/PickThumb.app/PickThumb

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
      objc-class-ref in PickThumbViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

    标签: ios5 alassetslibrary


    【解决方案1】:

    您需要将AssetsLibrary 框架添加到PickThumb 目标的“Link Binary With Libraries”构建阶段。

    How to "add existing frameworks" in Xcode 4?

    【讨论】:

    • 添加后我收到此错误:ld: warning: ignoring file /Users/vedprakash/Documents/XCode Projects/PickThumb/AssetsLibrary.framework/AssetsLibrary, file was built for unsupported file format which is not the architecture being linked (i386)
    • 这不是AssetsLibrary 框架的正确位置。我认为您没有按照链接中的说明进行操作。
    • 我已经在链接中添加了框架,并且该库显示在“Link Binary with Libraries”下的列表中
    • 如果你正确添加了链接命令,它应该是-framework AssetsLibrary。它不应该有以/AssetsLibrary 结尾的路径。
    • 谢谢罗伯:)。我删除并添加了库并成功构建。
    【解决方案2】:

    我刚刚在 Xcode 10.2 中添加了

    AssetsLibrary.framework
    

    在 Target>Build Phases> Link Binary With Libraries 部分

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-16
      • 2018-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多