【问题标题】:Build fail when using SDWebImage使用 SDWebImage 时构建失败
【发布时间】:2012-09-06 18:25:11
【问题描述】:

我正在尝试在我的项目中使用SDWebImage 的类。

我已将这些类添加到我的项目中,当我尝试构建它时出现 7 个错误:

    Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_MKAnnotationView", referenced from:
      l_OBJC_$_CATEGORY_MKAnnotationView_$_WebCache in MKAnnotationView+WebCache.o
  "_CGImageSourceCreateIncremental", referenced from:
      -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
  "_CGImageSourceUpdateData", referenced from:
      -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
  "_CGImageSourceCopyPropertiesAtIndex", referenced from:
      -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
  "_CGImageSourceCreateImageAtIndex", referenced from:
      -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
  "_kCGImagePropertyPixelHeight", referenced from:
      -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
  "_kCGImagePropertyPixelWidth", referenced from:
      -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我是 XCode 和 Objective-c 的新手,所以我不知道这个错误是什么意思。

有人吗?

谢谢。

【问题讨论】:

标签: objective-c xcode sdwebimage


【解决方案1】:

看来您需要将MapKitImageIO 添加到项目中。

这样做:

  1. 单击 Xcode 中项目导航器顶部的项目。
  2. 选择“构建阶段”选项卡。
  3. 打开“将二进制文件与库链接”框。
  4. 点击“+”。
  5. App MapKit 和 ImageIO 框架。

【讨论】:

  • 我这样做了,现在出现了 6 个错误:我列出的所有错误都减去了第一个错误(包含 _OBJC_CLASS_$_MKAnnotationView)。
  • CoreGraphics 也是这样吗?虽然在 iOS Xcode 项目模板中应该已经存在。
  • ImageIO 解决了它。你怎么做才能知道缺少什么框架? XCode 错误消息对我来说不是很清楚。
  • 我只知道那些符号在那些框架中。 MapKit 很简单,因为课程以MK 开头。 ImageIO 更难,这就是为什么我一开始弄错了,并认为它可能是 QuartzCore。我刚查了文档,发现这些函数在 ImageIO 中。
  • 你太棒了!我遇到了同样的错误,结果证明需要 Mapkit 框架。除非我忽略了它,否则我不记得在说明中看到过这一点。非常感谢,谢谢。 :-)
猜你喜欢
  • 2018-10-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-12-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多