【已解决】Error:未定义标识符 ComRender

在线求助:
用cocostudio scene编辑器后,在3.0beta2下试图获得一个按钮。
ComRender render = static_cast<ComRender>(pGameScene->getChildByTag(10013)->getComponent(“GUIComponent”));
结果报错Error:未定义标识符 ComRender

已经引用了libCocosStudio。

除了要引入libCocosStudio

还需声明命名空间和引入头文件

#include “cocos2d.h”
#include “extensions/cocos-ext.h”
#include “gui/CocosGUI.h”
#include “cocostudio/CocoStudio.h”

using namespace cocostudio;
USING_NS_CC;
USING_NS_CC_EXT;
using namespace gui;

已解决,在github上下了3.0的Sample,发现需要:
#include “cocostudio/CocoStudio.h”
using namespace cocostudio;

3.0beta2中是不是把ComRender所在的CocoStudio从extensions中独立出来了?
最先我也是这么写的还是不行啊。

您好,3.0确实独立出来了,而且GUI也是独立的。所以上边最必须的是

#include “gui/CocosGUI.h”
#include “cocostudio/CocoStudio.h”
using namespace gui;
using namespace cocostudio;

不过另外两个是基础了。

斑竹大大,又有新的问题了。
button加上listener后就有错误:
buttonPlay->addTouchEventListener(this,toucheventselector(HelloWorld::PlayPressed));

void PlayPressed(Object* pSender){
}

然后:
warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/SAFESEH”规范
error LNK2019: 无法解析的外部符号 “public: void __thiscall HelloWorld::PlayPressed(class cocos2d::Object *)” (?PlayPressed@HelloWorld@@QAEXPAVObject@cocos2d@@@Z),该符号在函数 “public: virtual bool __thiscall HelloWorld::init(void)” (?init@HelloWorld@@UAE_NXZ) 中被引用
warning LNK4098: 默认库“libcmt.lib”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
…blablabla…

平台是win8.1 x64 + VS2012 + cocos2dx 3.0beta2 + cocostudio 1.2.0

2014.03.18
已解决,原因:函数定义时未加上类名。