Question

When I build this code I am getting an error,

AVAsset *asset = [AVAsset assetWithURL:ur];
AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc]initWithAsset:asset];
CMTime time = CMTimeMake(2, 1);
CGImageRef imageRef = [imageGenerator copyCGImageAtTime:time actualTime:NULL error:NULL];
UIImage *thumbnail = [UIImage imageWithCGImage:imageRef];

cell.imageView.image=thumbnail;
CGImageRelease(imageRef);

Error

Undefined symbols for architecture i386: "_CGImageRelease", referenced from:      
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have added libc++.dylib but still error persists. How can I resolve this?

Was it helpful?

Solution 2

Adding CoreGraphics framework resolves my problem.

OTHER TIPS

You need to add QuartzCore.framework to your project so that the code links. This API is part of QuartzCore framework in iOS. Also, where using it, use #import <QuartzCore/QuartzCore.h>

Hope that helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top