使用SDWebImage时构建失败

gab*_*ira 14 xcode objective-c sdwebimage

我想在我的项目中使用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)
Run Code Online (Sandbox Code Playgroud)

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

任何人?

谢谢.

mat*_*way 53

看起来你需要添加MapKitImageIO项目.

要做到这一点:

  1. 单击Xco​​de中项目导航器顶部的项目.
  2. 选择"构建阶段"选项卡.
  3. 打开"链接二进制文件库"框.
  4. 点击"+".
  5. 应用MapKit和ImageIO框架.