我得到错误架构i386的未定义符号:运行我的程序时

Xtr*_*k3r 3 compiler-errors objective-c ios

我想在我的图像视图中添加一个gif,所以按照网上的说明,我导入了我下载的类FLAnimatedImageFLAnimatedImageView类.我将它们添加到我的项目中的一个组中,选择了副本,并使用了这些类.现在我得到15个错误,如下所述.

描述部分是:

Ld "/Users/mark/Library/Developer/Xcode/DerivedData/iMark_OS-dmxhnswrkktqsacxqtlldejutoqb/Build/Products/Debug-iphonesimulator/iMark OS.app/iMark OS" normal i386
    cd "/Users/mark/Desktop/Xcode Projects/iMark OS"
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/mark/Library/Developer/Xcode/DerivedData/iMark_OS-dmxhnswrkktqsacxqtlldejutoqb/Build/Products/Debug-iphonesimulator -F/Users/mark/Library/Developer/Xcode/DerivedData/iMark_OS-dmxhnswrkktqsacxqtlldejutoqb/Build/Products/Debug-iphonesimulator -filelist "/Users/mark/Library/Developer/Xcode/DerivedData/iMark_OS-dmxhnswrkktqsacxqtlldejutoqb/Build/Intermediates/iMark OS.build/Debug-iphonesimulator/iMark OS.build/Objects-normal/i386/iMark OS.LinkFileList" -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework CoreData -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/mark/Library/Developer/Xcode/DerivedData/iMark_OS-dmxhnswrkktqsacxqtlldejutoqb/Build/Products/Debug-iphonesimulator/iMark OS.app/iMark OS"
Run Code Online (Sandbox Code Playgroud)

错误部分是:

Undefined symbols for architecture i386:
  "_CACurrentMediaTime", referenced from:
      ___42-[FLAnimatedImage addFrameIndexesToCache:]_block_invoke_2 in FLAnimatedImage.o
  "_CGImageSourceCopyProperties", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_CGImageSourceCopyPropertiesAtIndex", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_CGImageSourceCreateImageAtIndex", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
      -[FLAnimatedImage predrawnImageAtIndex:] in FLAnimatedImage.o
  "_CGImageSourceCreateWithData", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_CGImageSourceGetCount", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_CGImageSourceGetType", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_OBJC_CLASS_$_CADisplayLink", referenced from:
      objc-class-ref in FLAnimatedImageView.o
  "_UTTypeConformsTo", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_kCGImagePropertyGIFDelayTime", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_kCGImagePropertyGIFDictionary", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_kCGImagePropertyGIFLoopCount", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_kCGImagePropertyGIFUnclampedDelayTime", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.o
  "_kUTTypeGIF", referenced from:
      -[FLAnimatedImage initWithAnimatedGIFData:] in FLAnimatedImage.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)

我该如何解决?

Xtr*_*k3r 12

我想到了.有3个缺少的框架,QuartzCore,ImageIO和MobileCoreServices.对于任何具有相同问题的未来查看者,您可以查看.h和.m文件以查看它们导入的框架.图片:

.H:.h文件导入 .M.m文件导入

然后,单击项目,进入构建阶段,将二进制文件与库链接,并为项目和项目测试添加框架.不确定你是否必须为它们添加.嗯,这对我有用,所以希望它适用于其他人.