xcode 使用 SDWebImage 时构建失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12306161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Build fail when using SDWebImage
提问by gabsferreira
I am trying to use the classes of SDWebImagein my project.
我正在尝试在我的项目中使用SDWebImage的类。
I've added the classes to my project and when I try to build it I get 7 errors:
我已将这些类添加到我的项目中,当我尝试构建它时,出现 7 个错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MKAnnotationView", referenced from:
l_OBJC_$_CATEGORY_MKAnnotationView_$_WebCache in MKAnnotationView+WebCache.o
"_CGImageSourceCreateIncremental", referenced from:
-[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
"_CGImageSourceUpdateData", referenced from:
-[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
"_CGImageSourceCopyPropertiesAtIndex", referenced from:
-[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
"_CGImageSourceCreateImageAtIndex", referenced from:
-[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
"_kCGImagePropertyPixelHeight", referenced from:
-[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
"_kCGImagePropertyPixelWidth", referenced from:
-[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am new to XCode and Objective-c so I got no idea what this errors mean.
我是 XCode 和 Objective-c 的新手,所以我不知道这个错误是什么意思。
Anyone?
任何人?
Thank you.
谢谢你。
回答by mattjgalloway
Looks like you need to add MapKit
and ImageIO
to the project.
看起来您需要将MapKit
和添加ImageIO
到项目中。
To do that:
要做到这一点:
- Click on the project at the top of the project navigator in Xcode.
- Select the 'Build Phases' tab.
- Open up the 'Link Binary with Libraries' box.
- Click the '+'.
- App MapKit and ImageIO frameworks.
- 单击 Xcode 中项目导航器顶部的项目。
- 选择“构建阶段”选项卡。
- 打开“链接二进制与库”框。
- 单击“+”。
- 应用 MapKit 和 ImageIO 框架。