14

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.

gabsferreira
  • 3,089
  • 7
  • 37
  • 61
  • possible duplicate of [symbol(s) not found for architecture i386 in SDWebImageDownloader](http://stackoverflow.com/questions/11900848/symbols-not-found-for-architecture-i386-in-sdwebimagedownloader) – vikingosegundo Jan 20 '13 at 18:19

1 Answers1

53

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.
mattjgalloway
  • 34,792
  • 12
  • 100
  • 110
  • 1
    I did this and I got 6 errors now: all the ones I've listed minus the first one(that envolves _OBJC_CLASS_$_MKAnnotationView). – gabsferreira Sep 06 '12 at 20:23
  • CoreGraphics as well then? That should already be in there though in an iOS Xcode project template. – mattjgalloway Sep 06 '12 at 20:48
  • ImageIO solved it. What do you do to know what framework is missing? XCode error messages aren't very clear to me. – gabsferreira Sep 06 '12 at 21:50
  • 1
    I just know that those symbols are in those frameworks. The MapKit one is easy since the class starts with `MK`. The ImageIO ones are harder and that's why I got them wrong at first and thought it might be QuartzCore. I just checked the documentation and found that those functions are in ImageIO. – mattjgalloway Sep 07 '12 at 11:31
  • You are awesome! I had the same error and turns out the Mapkit framework was needed. Unless I overlooked it I don't recall seeing this in the instructions. Much appreciated, thanks. :-) – Shannon Cole Jul 10 '13 at 02:22