[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: How to embed LuaLanes ?
- From: dualface <dualface@...>
- Date: Sat, 26 Jan 2013 23:11:15 +0800
I tried:
extern int luaopen_lanes_core( lua_State* L);
int lanes_core_loader(lua_State* L)
{
lua_pushliteral(L, "lanes.core");
luaopen_lanes_core(L);
return 1;
}
lua_getglobal(L, "package");
lua_getfield(L, -1, "preload");
lua_pushcfunction(L, lanes_core_loader);
lua_setfield(L, -2, "lanes.core");
lua_pop(L, 2);
----------------------------------------
test.lua:
local lanes = require("lanes").configure()
get error:
lanes.lua:120: main: function 'package.preload.lanes.core' not found
in Keeper #1 destination transfer database.
----------------------------------------
Hoping to get help, thanks.