lua-users home
lua-l archive

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


Hi Sam,

thanks for the answer,

On Thu, Oct 27, 2016 at 11:33 AM, Sam Chang <sam.chang@me.com> wrote:
1#
Change:
example2 = require("example2")
to:
require("example2”)

this works, thanks,

or 2#

LUA_API int luaopen_example2(lua_State *L) {
    static const struct luaL_Reg example2[] = {
      { "get_str", _wrap_get_str },
      { NULL, NULL }
    };
    luaL_newlib(L, example2);
    return 1;
}


this doesn't work - with or without assignment (example2 = require("example2") or simple require("example2")) I got:

attempt to index global 'example2' (a boolean value)

Your first solution would be enough, I just want to understand the all flow.


Thanks again,


a.