lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.