简体   繁体   中英

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

Add "CoreImage" framework.

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

确保已将QuartzCore框架添加到项目中(Linked Frameworks)!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM