3

I am currently implementing GPUimage into my iOS application and I'm getting the following error:

'GPUImage.h' file not found

I have found several potential fixes, however, none of them worked for me. I am pretty sure it has something to do with my "Header Search Paths" which currently look like this:

../../../framework (set to recursive)

I've tried multiple variations of the Header Search Path with no luck. GPUImage is in my frameworks folder which I believe is the norm. I have double check and have imported everything correctly.

Any fixes or ideas would be greatly appreciated.

David Ansermot
  • 6,052
  • 8
  • 47
  • 82

1 Answers1

0

Okay, I remember how to do this now. First Brad's instructions for adding the framework to your project is kind of bogus. That is if it is a "framework" you should be able to add the framework to your project without adding the source.

When you write the line #import <GPUImage/GPUImage.h> it is looking in the framework for the GPUImage.h file and not finding it. It is not finding it because the GPUImage.h file target membership is not set to public.

The simple fix, which is not so simple, is to set GPUImage.h target membership to public and rebuild the framework. The problem is all the included h files in GPUImage.h also need to be set to public, but not all of them are. And there are over 160 h files in the framework. Best to follow the steps below and let xcode tell you which h files it still can't find.

To set the target membership in xcode,

  1. open the GPUImage project in xcode
  2. Open the GPUImage.h file
  3. In the Utility window on the right select the file inspector tab, which looks like a page with a little fold at the top right corner.
  4. under Target Membership check GPUImageFramework and change "project" to "public" from the drop down menu.
  5. Rebuild the GPUImageFramework for "Generic iOS Device".
  6. Under the Product group right click on the GPUImageFramework and select open in Finder.
  7. Drag the newly built Framework to your project and unselect "copy items if needed" is unchecked. That way if you need to rebuild the project after making the other h files public you won't have to.
izzy
  • 1,309
  • 1
  • 15
  • 25
  • what doesn't work? Did you set GPUImage.h target membership to public and got the same error? Did you rebuild the framework and make sure the newly generated framework is part of your project? What error are you getting? – izzy Mar 12 '16 at 19:35
  • Already fixed. You need drag GPUImage file to your own project first. – Rambo Li Mar 12 '16 at 20:39
  • yes, it helps to have the framework included in your project :) – izzy Mar 12 '16 at 20:56