Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Linker error: _OBJC_CLASS_$_CIImage

When building my Xcode project I am receiving a Linker error that I cannot figure out how to resolve. If I build the following code the compile step completes just fine but I get an error from the Linker saying '"_OBJC_CLASS_$_CIImage", referenced from Objc-class-ref-to-CIImage in AppController.o' followed by a second error that looks identical except CIImage is replaced with CIFilter followed by a statement that says "Symbol(s) not found"

CIFilter *transform = [CIFilter filterWithName:@"CIAffineTransform"];
[transform setValue:inputBitmap forKey:@"inputImage"];
NSAffineTransform *affineTransform = [NSAffineTransform transform];
[affineTransform rotateByDegrees:3];
[transform setValue:affineTransform forKey:@"inputTransform"];
CIImage * result = [transform valueForKey:@"outputImage"];

This code is in my AppController.m, and the Linker error showed up after I put the following statement up at the top:

#import "QuartzCore/CIFilter.h"

I put that import statement in because, without it I get a Compiler error on the first line of code that says "No +filterWithName method found" and I read somewhere that Cocoa automatically includes CIImage.h but not CIFilter.h. So ... with the #import the compiler error disappears but I get the linker error. :(

Any ideas what is causing the Linker error and how to get rid of it?

FYI: I tried searching for duplicate files as described in another "xcode linker error" thread herein, but could not find any duplicate files in my project. I also went to the trouble to create a completely new Project, and copy all my code from the old project to the new one, just to eliminate the possibility that I had somehow accidentally corrupted my project files. I still have the same issue in my new project.

Thanks

like image 976
Adam Avatar asked Jun 04 '10 17:06

Adam


2 Answers

Add "CoreImage" framework.

(Well, I know this question is old. But I had a same problem and adding "QuartzCore" framwork didn't help it).

like image 175
Sukhi Avatar answered Sep 18 '22 19:09

Sukhi


Make sure you've added the QuartzCore framework to your project (Linked Frameworks)!

like image 40
Wevah Avatar answered Sep 19 '22 19:09

Wevah