1.
给这个测试库取名为dylib,它包含一个函数add。lua中这样使用:
local dylib = require "dylib.test"
local c = dylib.add(1,2)
print(c)
上面的dylib.test就是我编译生成的dylib/test.so文件。这个文件该怎么生成?如下:
int
luaopen_dylib_test(lua_State* L) {
luaL_Reg l[] = {
{ "add", *dylib_add* },
{ NULL, NULL },
};
luaL_checkversion(L);
luaL_newlib(L,l);
return 1;
}
http://blog.csdn.net/laozitianxia/article/details/46894883
2.c++
http://www.cnblogs.com/lancidie/archive/2011/06/02/2068774.html
3.skynet
./skynet examples/config
./3rd/lua/lua examples/client.lua
http://www.jellythink.com/archives/511