1、下载https://github.com/BradLarson/GPUImage
2、拖拽GPUImage-master/framework/目录下的GPUImage.xcodeproj到工程
3、切换到项目targets-Build Phases。在Dependencies中加入GPUImageFramework。在Link Binary With Libraries中加入GPUImage。点击左上角的+号,选择new Copy Files build phase,把Destination设置为Frameworks,点击下面的+号,添加GPUImage.framework。注意:若是没有添加new Copy Files build phase,会报错dyld: Library not loaded: @rpath/GPUImage.framework
github原文:
Xcode 6 and iOS 8 support the use of full frameworks, as does the Mac, which simplifies the process of adding this to your application. To add this to your application, I recommend dragging the .xcodeproj project file into your application's project (as you would in the static library target).
For your application, go to its target build settings and choose the Build Phases tab. Under the Target Dependencies grouping, add GPUImageFramework on iOS (not GPUImage, which builds the static library) or GPUImage on the Mac. Under the Link Binary With Libraries section, add GPUImage.framework.
You then need to add a new Copy Files build phase, set the Destination to Frameworks, and add the GPUImage.framework build product to that. This will allow the framework to be bundled with your application (otherwise, you'll see cryptic "dyld: Library not loaded: @rpath/GPUImage.framework/GPUImage" errors on execution).
4、import GPUImage
5、设置info.plist相机相册麦克风权限
iOS 解决dyld: Library not loaded: @rpath/xxx.framework/ Reason: image not found
注:GPUImage有三个版本:GPUImage、GPUImage2、GPUImage3。可以用pod下载,但只能下第一版,要用后俩版本需要手动下载配置工程
网友评论