“GPUImage.h” not found

你说的曾经没有我的故事 提交于 2019-12-03 11:02:48

Your path has to be relative to the actual directory location relative to the project file. If you change it to this:

GPUITest3/BradLarson-GPUImage-f67cbd9/framework/**

then it will work just fine.

from github readme file(step 1 ~ 3):

  1. Start by dragging the GPUImage.xcodeproj file into your application's Xcode project to embed the framework in your project.

  2. go to your application's target and add GPUImage as a Target Dependency.

  3. you'll want to drag the libGPUImage.a library from the GPUImage framework's Products folder to the Link Binary With Libraries build phase in your application's target.

  4. if you meet following errors

    “GPUImage.h” not found
    

    then the straightforward way is to add the directory to your header search paths:

    PathToGpuFramework/frameworksource
    PathToGpuFramework/frameworksource/iOS
    

I spent more than 2 hours on this issue, read almost every answer on the web, Found the best solution.

1.Copy the GPUImage folder inside your own Project Folder. Also, drag and drop the 'GPUImage.xcodeproj' into your project inside Xcode.

2.Inside Xcode, in the select "Search header paths", press Enter/return, type $(PROJECT_DIR), press Enter/return and then double-click on it and change "non-recursive" to "recursive".

P.S - The $(PROJECT_DIR) command will automatically fill up the path to the GPUImage header files.

For some reason, I have NEVER been able to make this work with the Search Header paths.

My solution: in Prefix-pch (or wherever you want to import it, but Prefix-pch is easiest), #import "framework/Source/GPUImage.h" - maybe this is what you are supposed to do, maybe not. I don't really know, but the directions say just to use #import "GPUImage.h"

Also note that if you follow the directions in the readme, and simply drag the GPUImage framework to your project, you are only creating a reference. The library will still be in your downloads folder or wherever you unzipped it. This doesn't work for me bc all of my projects are in Dropbox for cloud backup and use on multiple machines. The way in the directions might be how some people like to do it. It might even be a best practice for all I know, but I like to have each project be self contained. My solution to that is to drag the zip file downloaded from github to my project folder and unzip it there. THEN drag the GPUImage project file to your project in xcode.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!