Build fail when using SDWebImage

gabsferreira picture gabsferreira · Sep 6, 2012 · Viewed 9.4k times · Source

I am trying to use the classes of SDWebImage in my project.

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

    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.

Anyone?

Thank you.

Answer

mattjgalloway picture mattjgalloway · Sep 6, 2012

Looks like you need to add MapKit and ImageIO to the project.

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.