import "cocos2d.h" works in some files, but not all import "cocos2d.h" works in some files, but not all xcode xcode

import "cocos2d.h" works in some files, but not all


Turns out I had only added the "user header search paths" to my target, but not in the project settings.

Adding it fixed the problem. I guess the reason it compiled fine was because I had added it to the target, but it didn't work in the text editor since I hadn't added it to the project.


This happened to me as well, even though I did add it to both project and target.

However, what worked for me was to select the RECURSIVE checkbox under "User Header Search Prefixes" (which was set to "/lib/**")


I had same issue.

My project -> Build Settings
Look for the entry for Search Paths

Always Search User Paths - YES

User Header Search paths - "myProjectName/libs" //I put box2d folder here

Hope this help someone.