'cocos2d.h' file not found

I downloaded a sample project from github.
But I had no cocos2d lib and prefix.pch.
So I cloned them from my original project and add them to it.
But this error found and couldn’t run it.

Prefix.pch:11:11: ‘cocos2d.h’ file not found

I tried clean project and remove XCode Derived Data & restart Xcode.
But this error didn’t be fixed.

My Cocos2d-x version is 3.81.
Xcode version is 7.3.

me too have this problem, all link binaries linked in, but still

You need to make sure your header search paths are set in Build Settings.

run cocos new ... and have a look at what they are set at.

this will help you …read it in detail

This doesn’t solve their problem. It is an option instead of using the source directly. They will still need to set their header search paths and add the static libraries to their projects.

it is the same. And the path you are using is my path!

opps sorry, thanks @slackmoehrle the probs solved now :slight_smile:

I’m new to cocos2d-x and even less fortunately new to developing on mac. I’ve tried downloading the programmers-guide-samples project…and think I’m mostly there:

In my libs folder I have:
|libjscocos2d Mac.a
|libsimulator Mac.a
|libcocos2d Mac.a
|libluacocos2d Mac.a

opening XCode 9.3 as described in the README, and building, I get 2 errors:
“Lexical or preprocessor issue”
“cocos2d.h file not found”

I’m guessing the first error will be solved if I manage to fix the header search paths, but I cannot for the life of me navigate XCode. Everybody is talking about build settings menus and BUILD_CONFIGURATION_PATH and user header search paths, any derivation thereof, and I can’t find any of those anywhere! Also, the only target “scheme” I’m getting is “Chapter 2 mac”. Searching around the forums, this appears to be because the mac side of the programmers-guide-sample project was incomplete, though I don’t mind that if I can figure out how to add schemes myself, I’d even help update documentation.

Also, slackmoehrle mentioned running "run cocos new … " to find where the search path needs to point to. This didn’t help me. Where might I expect to go to find this location on a mac? All I got when doing this was the expected output of lines:

Copy template into /Users/james/Desktop/Projects/TryAgain2
Copying Cocos2d-x files…
…etc

Finally, I’ve gotten the general cocos2d-x zip compiled and running fine. I can run the Cpp tests perfectly well, so I know my overall environment isn’t an issue…And I’ve ran it through XCode as well. Thanks for any help!