“GPUImage.h” not found

淺唱寂寞╮ 提交于 2020-01-12 06:58:48

问题


I am trying to set up GPUImage in a project but I am not able to track down why I'm getting the error: "GPUImage.h" not found. I have added the framework, setup the target dependency, added the Header Search path as: framework, and added other linker flag -ObjC. Still no luck. I have included my super simple test project here and linked below if anyone wants to take a look.

I know this must be documented and basic, but I searched on GitHub but did not find reference to this particular issue.

Thanks for reading.

owolf.net/uploads/StackOverflow/GPUITest.zip


回答1:


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.




回答2:


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
    



回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/12105698/gpuimage-h-not-found

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