一、在编写新建项目中,会报一下错误,经过排查,应该是命名空间的问题,在头文件定义之后,加入相应的命名空间就解决了。
比如 using namespace std,USING_NS_CC; 等等。
还有可能就是没有包含相应的头文件。。
1>e:\cocos\start\start\proj.win32\gamelayer.h(22): error C2143: 语法错误 : 缺少“;”(在“*”的前面)
1>e:\cocos\start\start\proj.win32\gamelayer.h(22): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int1>e:\cocos\start\start\proj.win32\gamelayer.h(22): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\cocos\start\start\proj.win32\gamelayer.h(23): error C2143: 语法错误 : 缺少“;”(在“*”的前面)
1>e:\cocos\start\start\proj.win32\gamelayer.h(23): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\cocos\start\start\proj.win32\gamelayer.h(23): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\cocos\start\start\proj.win32\gamelayer.cpp(7): error C2065: “background1”: 未声明的标识符
1>e:\cocos\start\start\proj.win32\gamelayer.cpp(8): error C2065: “background2”: 未声明的标识符
1>e:\cocos\start\start\proj.win32\gamelayer.cpp(26): error C2065: “background1”: 未声明的标识符