forthxu / talkbox

a talkbox build with skynet
forthxu.com
MIT License
149 stars 74 forks source link

技术渣新手求助 我在mac环境编译 遇到了这个问题 查了好久 实在不知道怎么搞了, 求云风大神指点 #4

Open phynero opened 7 years ago

phynero commented 7 years ago

phynero@mac:~/project/skytest/talkbox > bash start.sh

---------- 开始 ---------- ---------- 处理protocbuf ---------- cd build && ar rc libpbc.a ../build/o/context.o ../build/o/varint.o ../build/o/array.o ../build/o/pattern.o ../build/o/register.o ../build/o/proto.o ../build/o/map.o ../build/o/alloc.o ../build/o/rmessage.o ../build/o/wmessage.o ../build/o/bootstrap.o ../build/o/stringpool.o ../build/o/decode.o cd build && gcc -O2 -fPIC -I.. -L. -o addressbook ../test/addressbook.c -lpbc cd build && gcc -O2 -fPIC -I.. -L. -o pattern ../test/pattern.c -lpbc cd build && gcc -O2 -fPIC -I.. -L. -o pbc ../test/pbc.c -lpbc cd build && gcc -O2 -fPIC -I.. -L. -o float ../test/float.c -lpbc cd build && gcc -O2 -fPIC -I.. -L. -o map ../test/map.c -lpbc cd build && gcc -O2 -fPIC -I.. -L. -o test ../test/test.c -lpbc ../test/test.c:48:2: warning: implicit declaration of function '_pbcM_memory' is invalid in C99 [-Wimplicit-function-declaration] _pbcM_memory(); ^ 1 warning generated. cd build && gcc -O2 -fPIC -I.. -L. -o decode ../test/decode.c -lpbc gcc -O2 -fPIC -Wall --shared -o protobuf.so -I../.. -I/usr/local/include -L/usr/local/bin -L../../build pbc-lua.c -lpbc -I../../../../skynet/3rd/lua/ Undefined symbols for architecture x86_64: "_luaL_buffinit", referenced from: pattern_pack in pbc-lua-845a8a.o "_luaL_checkinteger", referenced from: __rmessage_new in pbc-lua-845a8a.o rmessage_integer in pbc-lua-845a8a.o rmessage_int32 in pbc-lua-845a8a.o __rmessage_int64 in pbc-lua-845a8a.o rmessage_int52 in pbc-lua-845a8a.o rmessage_uint52 in pbc-lua-845a8a.o __rmessage_real in pbc-lua-845a8a.o ... "_luaL_checklstring", referenced from: env_register in pbc-lua-845a8a.o env_type in pbc-lua-845a8a.o __rmessage_new in pbc-lua-845a8a.o rmessage_integer in pbc-lua-845a8a.o rmessage_int32 in pbc-lua-845a8a.o __rmessage_int64 in pbc-lua-845a8a.o rmessage_int52 in pbc-lua-845a8a.o ... "_luaL_checknumber", referenced from: wmessage_real in pbc-lua-845a8a.o __wmessage_int52 in pbc-lua-845a8a.o wmessage_uint52 in pbc-lua-845a8a.o pattern_pack in pbc-lua-845a8a.o "_luaL_checktype", referenced from: decode in pbc-lua-845a8a.o "_luaLcheckversion", referenced from: _luaopen_protobuf_c in pbc-lua-845a8a.o "_luaL_error", referenced from: env_register in pbc-lua-845a8a.o env_type in pbc-lua-845a8a.o rmessage_new in pbc-lua-845a8a.o __rmessage_delete in pbc-lua-845a8a.o rmessage_integer in pbc-lua-845a8a.o rmessage_int32 in pbc-lua-845a8a.o __rmessage_int64 in pbc-lua-845a8a.o ... "_luaL_prepbuffsize", referenced from: pattern_pack in pbc-lua-845a8a.o "_luaL_pushresult", referenced from: pattern_pack in pbc-lua-845a8a.o "_luaL_setfuncs", referenced from: _luaopen_protobuf_c in pbc-lua-845a8a.o "_lua_callk", referenced from: _push_value in pbc-lua-845a8a.o "_lua_checkstack", referenced from: pattern_unpack in pbc-lua-845a8a.o "_lua_createtable", referenced from: _luaopen_protobuf_c in pbc-lua-845a8a.o pattern_unpack in pbc-lua-845a8a.o decode in pbc-lua-845a8a.o gc in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o "_lua_insert", referenced from: _decode_cb in pbc-lua-845a8a.o "_lua_isstring", referenced from: __rmessage_new in pbc-lua-845a8a.o pattern_unpack in pbc-lua-845a8a.o "_lua_isuserdata", referenced from: pattern_unpack in pbc-lua-845a8a.o "_lua_newuserdata", referenced from: gc in pbc-lua-845a8a.o "_lua_pushboolean", referenced from: env_type in pbc-lua-845a8a.o pattern_unpack in pbc-lua-845a8a.o decode in pbc-lua-845a8a.o _push_value in pbc-lua-845a8a.o "_lua_pushcclosure", referenced from: gc in pbc-lua-845a8a.o "_lua_pushinteger", referenced from: env_type in pbc-lua-845a8a.o __rmessage_integer in pbc-lua-845a8a.o rmessage_size in pbc-lua-845a8a.o wmessage_buffer in pbc-lua-845a8a.o __pattern_size in pbc-lua-845a8a.o pattern_unpack in pbc-lua-845a8a.o _push_value in pbc-lua-845a8a.o ... "_lua_pushlightuserdata", referenced from: env_new in pbc-lua-845a8a.o __rmessage_new in pbc-lua-845a8a.o rmessage_int32 in pbc-lua-845a8a.o rmessage_message in pbc-lua-845a8a.o __wmessage_new in pbc-lua-845a8a.o wmessage_message in pbc-lua-845a8a.o wmessage_buffer in pbc-lua-845a8a.o ... "_lua_pushlstring", referenced from: __rmessage_int64 in pbc-lua-845a8a.o rmessage_string in pbc-lua-845a8a.o wmessage_buffer_string in pbc-lua-845a8a.o pattern_unpack in pbc-lua-845a8a.o _push_value in pbc-lua-845a8a.o "_lua_pushnumber", referenced from: rmessage_int52 in pbc-lua-845a8a.o __rmessage_uint52 in pbc-lua-845a8a.o rmessage_real in pbc-lua-845a8a.o pattern_unpack in pbc-lua-845a8a.o _push_value in pbc-lua-845a8a.o "_lua_pushstring", referenced from: __env_type in pbc-lua-845a8a.o last_error in pbc-lua-845a8a.o _push_value in pbc-lua-845a8a.o "_lua_pushvalue", referenced from: decode in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o _push_value in pbc-lua-845a8a.o "_lua_rawgeti", referenced from: pattern_pack in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o "_lua_rawlen", referenced from: pattern_pack in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o "_lua_rawseti", referenced from: __pattern_unpack in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o "_lua_setfield", referenced from: gc in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o "_lua_setmetatable", referenced from: gc in pbc-lua-845a8a.o "_lua_settop", referenced from: env_type in pbc-lua-845a8a.o pattern_pack in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o "_lua_toboolean", referenced from: __pattern_pack in pbc-lua-845a8a.o "_lua_tointegerx", referenced from: rmessage_string in pbc-lua-845a8a.o rmessage_message in pbc-lua-845a8a.o __pattern_unpack in pbc-lua-845a8a.o pattern_pack in pbc-lua-845a8a.o "_lua_tolstring", referenced from: rmessage_new in pbc-lua-845a8a.o __wmessage_int64 in pbc-lua-845a8a.o pattern_unpack in pbc-lua-845a8a.o pattern_pack in pbc-lua-845a8a.o "_lua_touserdata", referenced from: __env_register in pbc-lua-845a8a.o env_type in pbc-lua-845a8a.o rmessage_new in pbc-lua-845a8a.o __rmessage_delete in pbc-lua-845a8a.o rmessage_integer in pbc-lua-845a8a.o rmessage_int32 in pbc-lua-845a8a.o __rmessage_int64 in pbc-lua-845a8a.o ... "_lua_type", referenced from: env_type in pbc-lua-845a8a.o wmessage_int32 in pbc-lua-845a8a.o __wmessage_int64 in pbc-lua-845a8a.o pattern_pack in pbc-lua-845a8a.o __decode in pbc-lua-845a8a.o _decode_cb in pbc-lua-845a8a.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [all] Error 1 ./res/talkbox.proto: No such file or directory ---------- 处理协议 ---------- start.sh: line 70: cd: ./3rd/p/: No such file or directory ---------- 进入skynet目录 ----------

start.sh: line 74: cd: ./skynet/: No such file or directory

---------- 编译 ----------

make: *** No rule to make target `linux'. Stop.

---------- 拷贝协议so模块 ---------- cp: directory ./lualib does not exist cp: directory ./luaclib does not exist

---------- 执行 ---------

你妹啊,启动程序没有,./skynet

forthxu commented 7 years ago

protobuf编译失败 对这个单独编译看看

phynero commented 7 years ago

echo " >>---------- 处理protocbuf ----------"

mv ./3rd/pbc/Makefile ./3rd/pbc/Makefile.bak

mv ./3rd/pbc/binding/lua/Makefile ./3rd/pbc/binding/lua/Makefile.bak

cp ./3rd/pbcMakefile ./3rd/pbc/Makefile

cp ./3rd/pbcluaMakefile ./3rd/pbc/binding/lua/Makefile

cd ./3rd/pbc/ && make && cd ./binding/lua/ && make && cd ../../../../

生成协议

我自己编译了protobuf2.5 生成的protoc软甩到了user/bin 然后把上面的部分注释掉 直接执行下面那句 然后还是有问题 protoc -o ./res/talkbox.pb ./res/talkbox.proto

============================================= phynero@mac:~/project/skytest/talkbox > bash clean.sh Would remove 3rd/log/ Would remove 3rd/tmp/ Would remove res/talkbox.pb phynero@mac:~/project/skytest/talkbox > bash start.sh

---------- 开始 ---------- ---------- 处理protocbuf ---------- ---------- 处理协议 ---------- Undefined symbols for architecture x86_64: "_luaL_checkinteger", referenced from: pack in lua-p-59cfc6.o "_luaL_checklstring", referenced from: pack in lua-p-59cfc6.o unpack in lua-p-59cfc6.o "_luaL_error", referenced from: pack in lua-p-59cfc6.o "_luaL_setfuncs", referenced from: _luaopen_p_core in lua-p-59cfc6.o "_lua_createtable", referenced from: _luaopen_p_core in lua-p-59cfc6.o add in lua-p-59cfc6.o unpack in lua-p-59cfc6.o "_lua_pushinteger", referenced from: unpack in lua-p-59cfc6.o "_lua_pushlstring", referenced from: pack in lua-p-59cfc6.o "_lua_pushnumber", referenced from: add in lua-p-59cfc6.o "_lua_pushstring", referenced from: add in lua-p-59cfc6.o unpack in lua-p-59cfc6.o "_lua_rawseti", referenced from: add in lua-p-59cfc6.o "_lua_settable", referenced from: add in lua-p-59cfc6.o unpack in lua-p-59cfc6.o "_lua_tonumberx", referenced from: __add in lua-p-59cfc6.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ---------- 进入skynet目录 ----------

不知道怎么搞 求大神赐教

phynero commented 7 years ago

把lua-p.c和lua文件夹单拿到vps上去编译通过了

phynero commented 7 years ago

完全不是那么回事 不过已经在centos上跑通了 暂时在centos上学习了 mac不考虑了

wantao commented 7 years ago

哥,我想知道client和server之间消息包的格式

wantao commented 7 years ago

你的这个不支持枚举 lua loader error : ./lualib/proto_lua/ProtocType_pb.lua:6: attempt to call field 'EnumDescriptor' (a nil value)