我在mac上用的是cocos2dx3.1.1版,想做个添加自定义类到lua,照教程http://www.tuicool.com/articles/BBrEFr做得,最后终端输出<span style=""“font-family:Menlo;font-size:11px;line-height:normal;”"">Generating lua bindings succeeds. 说明已经成功,不过在lua调用得时候xcode打印<b style=""“font-family:Menlo;font-size:11px;line-height:normal;”"">ocos2d: LUA ERROR: …2-80EC-424D-AD78-D8A93FF3813E/game3 iOS.app/src/main.lua:230: error in function ‘lua_cocos2dx_UserDefine_TestT_create’.<span style=""“font-family:Menlo;font-size:11px;line-height:normal;”"">
argument #1 is 'class cc.TestT'; 'cc.TestT' expected.
参考了http://www.cnblogs.com/emyueguang/p/3713635.html也没找到问题所在,
--------------------.h代码
#ifndef game3_TestT_h
#define game3_TestT_h
#include "2d/CCSprite.h"
NS_CC_BEGIN
class CC_DLL TestT :public Node
{
public:
TestT * create();
};
NS_CC_END
#endif
#include
#include "TestT.h"
NS_CC_BEGIN
TestT* TestT::create()
{
printf("---------createTest");
return nullptr;
}
NS_CC_END
-------------------
求解
ps头次发贴,不知代码如何弄求指点