“CCScale9Sprite”: 未声明的标识符 或“CCScale9Sprite”: 不是类或命名空间名称
2014-07-23 22:40
337 查看
今天遇到这个问题,想要测试一下CCControlButton这个类,但是VS2010老是报“CCScale9Sprite”: 未声明的标识符 “CCScale9Sprite”: 不是类或命名空间名称这类的错误,VS2010中的测试代码如下:
1. 展开Debug|Win32 -> 双击Microsoft.Cpp.Win32.user -> VC++目录-> 包含目录 ->编辑添加 extensions到include中
2. 在属性->链接器->添加libExtensions.lib这个库文件
3. 在源文件中添加头文件 #include "costex.h"
4. 再添加 using namespace cocos2d::extensions; (有的版本可能是extension)
这样上面的错误就可能清除了。
CCScale9Sprite *btnNormal = CCScale9Sprite::create("HelloWorld.png"); CCScale9Sprite *btnDown = CCScale9Sprite::create("HelloWorld.png"); CCLabelTTF *title = CCLabelTTF::create("Touch Me!3324234", "Marker Felt", 30); CCControlButton* controlBtn = CCControlButton::create(title, btnNormal); controlBtn->setBackgroundSpriteForState(btnDown, CCControlStateSelected); controlBtn->setPosition(ccp(200, 200)); this->addChild(controlBtn)
1. 展开Debug|Win32 -> 双击Microsoft.Cpp.Win32.user -> VC++目录-> 包含目录 ->编辑添加 extensions到include中
2. 在属性->链接器->添加libExtensions.lib这个库文件
3. 在源文件中添加头文件 #include "costex.h"
4. 再添加 using namespace cocos2d::extensions; (有的版本可能是extension)
这样上面的错误就可能清除了。
相关文章推荐
- 调用opencv时,使用Egien工具出现“error C2061: 语法错误: 标识符“Matrix””和“error C2653: “Eigen”:不是类或命名空间名称”该如何解决?
- “SXMPDocOps”: 不是类或命名空间名称
- 静态切分窗口问题(error C2653: “CCSDI_2View”: 不是类或命名空间名称)
- error C2653: “io_fnd”: 不是类或命名空间名称
- error C2653: “***”不是类或命名空间名称
- 运行提示 error C2653: “CMFCVisualManagerScenic”: 不是类或命名空间名称。
- 做OSG开发出现error C2653: “osgViewer”: 不是类或命名空间名称
- vs 2015 不是类或命名空间名称
- error C2653: “CXXXX”: 不是类或命名空间名称
- “boost”: 不是类或命名空间名称,该怎么解决
- “Stock”: 不是类或命名空间名称
- error C2653: “Cfile”: 不是类或命名空间名称
- 手工添加新类,调试的时候提示不是类或命名空间名称
- error C2653: “***”不是类或命名空间名称
- 拆分窗口问题-- error C2653: “CtestView”: 不是类或命名空间名称
- Qt项目中include了fstream,iostream头文件,但是还是会报:error C2653: “ios”: 不是类或命名空间名称
- cocos2d-x 3.0 :"ui”: 不是类或命名空间名称
- “System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”错误的解决方法
- 关于错误“System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”
- 错误:CS0234: 命名空间“System”中不存在类型或命名空间名称“Linq”的解决方法