objective-cxcodecocos2d-iphonebox2d-iphone

Lexical or preprocessor error: file not found using box2d & cocos2d


I'm having this weird issue when building my project. The problem is as follows:

My friend and I are working on a project and we're exactly using the same xcode, cocos2d and box2d versions. His project compiles (builds) fine while mine gives this error when I do: cassert file not found.

I took a copy of his xcode.project but no problems whatsoever.

I hope this code summarizes better what I'm trying to say:

GameLayer.h
#import bla bla //the usual required files
@class myOwnClass1;
@class myOwnClass2;

myOwnClass1 *test1;
myOwnClass2 *test2;

Now I wanna include the GameLayer.h in either myOwnClass1.h or myOwnClass2.h using #import but it would give me the error! If I did @class GameLayer; no problems at all.

The thing is in my friend's project he's doing the #import without the error, which is super weird (at least for me)

Advice?

P.S. I know that changing the .m to .mm would solve it but, again, in my friend's project he's using the .m


Solution

  • For some reason it turned out that creating a new project from scratch solved the problem, I'll mark this as the correct answer for now unless someone else has another opinion.