简体   繁体   English

架构i386中的CGImageRelease错误

[英]CGImageRelease Error in architecture i386

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. 我添加了libc++.dylib但错误仍然存​​在。 How can I resolve this? 我该如何解决?

You need to add QuartzCore.framework to your project so that the code links. 您需要将QuartzCore.framework添加到您的项目中,以便代码链接。 This API is part of QuartzCore framework in iOS. 该API是iOS中QuartzCore框架的一部分。 Also, where using it, use #import <QuartzCore/QuartzCore.h> 另外,在使用它的地方,使用#import <QuartzCore/QuartzCore.h>

Hope that helps! 希望有帮助!

添加CoreGraphics框架解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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