ios - 我收到错误 Undefined symbols for architecture i386 : when running my program

标签 ios objective-c compiler-errors

我正在尝试将 gif 添加到我的 ImageView 中,因此按照网上的说明,我导入了我下载的 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"

错误的部分是:

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)

我该如何解决这个问题?

最佳答案

我想通了。缺少 3 个框架,QuartzCore、ImageIO 和 MobileCoreServices。对于以后遇到同样问题的任何查看者,您可以查看 .h 和 .m 文件以查看它们导入了哪些框架。图片:

.h: .h file import .m .m file import

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

关于ios - 我收到错误 Undefined symbols for architecture i386 : when running my program,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28547992/

相关文章:

ios - 即使使用 Delegate=self 也不会调用 WebView 委托(delegate)并且还实现了 UIWebView 委托(delegate)协议(protocol)

iphone - 从 UITextField 输入动态调整 UITableView 大小

iphone - iOS:来自 youtube channel 的随机视频?

ios - 将 Spring 添加到 pageCurl CATransition

ios - 来自 iOS 应用程序/Objective-C 的 Google Fusion Tables?

ios - 使用Apple LLVM 4.1构建iOS应用时出错

安卓错误: cannot find symbol class ActionBarActivity

ios - MKMapView - 有没有办法将 MKUserTrackingModeFollow 与修改的中心/焦点一起使用?

ios - 对 NSArray 的 NSArray 中的 objectAtIndex 值求和或将值与 NSDictionary 中的键的现有值相加

java - 找不到符号 "OnKeyListener"