Question

I am getting this error when I try to run my unit tests. The entire error is:

    Undefined symbols for architecture i386:
  "_CGImageRelease", referenced from:
      _releaseImages in UIImage+animatedGIF.o
  "_CGImageSourceCopyPropertiesAtIndex", referenced from:
      _delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
  "_CGImageSourceCreateImageAtIndex", referenced from:
      _createImagesAndDelays in UIImage+animatedGIF.o
  "_CGImageSourceCreateWithData", referenced from:
      +[UIImage(animatedGIF) animatedImageWithAnimatedGIFData:] in UIImage+animatedGIF.o
  "_CGImageSourceCreateWithURL", referenced from:
      +[UIImage(animatedGIF) animatedImageWithAnimatedGIFURL:] in UIImage+animatedGIF.o
  "_CGImageSourceGetCount", referenced from:
      _animatedImageWithAnimatedGIFImageSource in UIImage+animatedGIF.o
  "_kCGImagePropertyGIFDelayTime", referenced from:
      _delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
  "_kCGImagePropertyGIFDictionary", referenced from:
      _delayCentisecondsForImageAtIndex in UIImage+animatedGIF.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I did all the instructions here: http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/

Also added the library to "Compile Sources" in Build Phrases of the test target. Still no luck.

Was it helpful?

Solution

Looks like you need to add "CoreGraphics.framework" and "ApplicationServices.framework" to your unit test target membership.

Here's how it's done for a file:

Make sure Target Membership is selected for your .m file

Just go to "CoreGraphics.framework" in the list of files and folders on the left side and make certain the checkmark is "ON" for the unit tests target.

OTHER TIPS

Go to build phases of target, Add ImageIO.framework

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top