Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I get error Undefined symbols for architecture i386: when running my program

I am trying to add a gif to my image view, so following instructions off the web, I imported the FLAnimatedImage and FLAnimatedImageView classes I downloaded. I added them to a group in my project, selected copy, and used Those classes. Now I get 15 errors, described below.

The description part is the :

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"

And the error part is:

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)

How do I fix this?

like image 234
XtremeHek3r Avatar asked Dec 08 '22 04:12

XtremeHek3r


1 Answers

I figured it out. There were 3 missing frameworks, QuartzCore,ImageIO, and MobileCoreServices. for any future viewers who have the same problem, you look in the .h and .m files to see what frameworks they import. Images:

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

Then, you click on project, go into build phases, link binary with libraries, and add the frameworks for both your project and projecttest . not really sure if you have to add for both of them. Well, that worked for me, so hopefully it works for other people.

like image 165
XtremeHek3r Avatar answered Dec 11 '22 09:12

XtremeHek3r