【发布时间】:2012-12-18 07:57:31
【问题描述】:
我在构建项目时遇到了这个奇怪的问题。问题如下:
我和我的朋友正在做一个项目,我们使用完全相同的 xcode、cocos2d 和 box2d 版本。 他的项目编译(构建)很好,而我的项目在我这样做时会出现此错误: 未找到 cassert 文件。
我复制了他的 xcode.project,但没有任何问题。
我希望这段代码能更好地总结我想说的:
GameLayer.h
#import bla bla //the usual required files
@class myOwnClass1;
@class myOwnClass2;
myOwnClass1 *test1;
myOwnClass2 *test2;
现在我想使用#import 在myOwnClass1.h 或myOwnClass2.h 中包含GameLayer.h,但这会给我错误!
如果我做了@class GameLayer; 完全没有问题。
事情是在我朋友的项目中,他正在做#import 没有错误,这非常奇怪(至少对我来说)
建议?
附:我知道将.m 更改为.mm 可以解决它,但是在我朋友的项目中,他再次使用.m
【问题讨论】:
-
您能否粘贴您收到的确切错误消息文本?并指定标记哪一行?
-
确切的错误消息是:
lexical or preprocessor error: file not found并显示b2dsettings.h中包含的#include <cassert>代码行。如果这对你来说还不够,我回家后会发布一些代码(macbook @home)
标签: objective-c xcode cocos2d-iphone box2d-iphone