想在3.6版本用云风的pbc ,
- 吧pbc 放在cocos2dx/cocos下,
2.在scripting/lua-bindings/manual下添加
lua_cocos2dx_pbc_manual
#include
“lua_cocos2dx_pbc_manual.h”
extern
“C” {
*//#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
*
#include
“pbc-lua.h”
*//#endif
*}
#include
“CCLuaEngine.h”
int register_pbc_module(lua_State* L)
{
lua_getglobal(L,
“_G”);
if (lua_istable(L,-1))*//stack:…,_G,
** *{
CCLOG(
“Rregister_pbc_module: %d”,CC_TARGET_PLATFORM);
*//#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
** *luaopen_protobuf_c(L);
printf(
“luaopen_protobuf_c”);
*//#endif
** *}
lua_pop(L, 1);
return 1;
}
3.修改scripting/lua-bindings/proj.android/下makefile
#pbc
LOCAL_SRC_FILES += …/manual/pbc/lua_cocos2dx_pbc_manual.cpp
4.修改Class/lua_module_register.h
register_pbc_module(L);5.copy protobuf 到script下编译都通过了,但是为什么在使用的时候 :1: module ‘protobuf.c’ not found: