2

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.

4

2 回答 2

5

看起来您需要将“CoreGraphics.framework”和“ ApplicationServices.framework”添加到您的单元测试目标成员资格中。

以下是对文件的处理方式:

确保为您的 .m 文件选择了 Target Membership

只需转到左侧文件和文件夹列表中的“CoreGraphics.framework”,并确保单元测试目标的复选标记为“ON”。

于 2013-09-13T01:52:09.867 回答
1

转到构建目标阶段,添加ImageIO.framework

于 2015-08-17T15:07:07.407 回答