ITeye博客

2015 年文章归档

共 2 篇文章

C++读取lua table

lua_pushnil(tolua_S); int index = lua_gettop(tolua_S); map<string, string> dict; // 现在的栈:-1 => nil; index => table index = index - 1; while (lua_next(tolua_S, index)) { // 现在的栈:-1 => value; -2 => key; index => table // 拷贝一份 key 到栈顶,然后对它做 lua_tostring 就不会改变原始的 key 值了 lua_pushvalue(tolua_S, -2); // 现…

2015-02-02 14:36 · cocos2d-x

静态库类重复

如果两个静态库冲突的结构是相同的,可以考虑将两个静态库拆分出来进行合并。 查看文件的架构有哪些 $ lipo -info libzbar.a Architectures in the fat file: libzbar.a are: armv7 (cputype (12) cpusubtype (11)) i386 将armv7解压出来 lipo libzbar.a -thin armv7 -output libzbar-armv7.a 新建立一个文件夹出来存放解压的(.o)文件 $ mkdir armv7 $ cd armv7 将静态库中的文件解压 $ ar -x ../libzbar-a…

2015-01-19 19:08 · cocos2d-x