views:

364

answers:

1

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

+3  A: 

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

Wevah
That was indeed the issue. Thanks so much!
Adam