xcode 使用 SDWebImage 时构建失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12306161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:25:46  来源:igfitidea点击:

Build fail when using SDWebImage

objective-cxcodesdwebimage

提问by gabsferreira

I am trying to use the classes of SDWebImagein my project.

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

I've added the classes to my project and when I try to build it I get 7 errors:

我已将这些类添加到我的项目中,当我尝试构建它时,出现 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)

I am new to XCode and Objective-c so I got no idea what this errors mean.

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

Anyone?

任何人?

Thank you.

谢谢你。

回答by mattjgalloway

Looks like you need to add MapKitand ImageIOto the project.

看起来您需要将MapKit和添加ImageIO到项目中。

To do that:

要做到这一点:

  1. Click on the project at the top of the project navigator in Xcode.
  2. Select the 'Build Phases' tab.
  3. Open up the 'Link Binary with Libraries' box.
  4. Click the '+'.
  5. App MapKit and ImageIO frameworks.
  1. 单击 Xcode 中项目导航器顶部的项目。
  2. 选择“构建阶段”选项卡。
  3. 打开“链接二进制与库”框。
  4. 单击“+”。
  5. 应用 MapKit 和 ImageIO 框架。