lua-users home
lua-l archive

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

>>>>> "Milan" == Milan Obuch <> writes:

 >> > test-lua.c:135:2: warning: implicit declaration of function
 >> > 'luaL_openlib' is invalid in C99 [-Wimplicit-function-declaration]  
 >> Compile your program with -DLUA_COMPAT_MODULE

 Milan> Thank you, this works. In lauxlib.h I see this is for
 Milan> compatibility with old module system, is there some replacement
 Milan> in new Lua world without module?

See luaL_newlib or luaL_setfuncs. It is not expected any more for
modules to either manipulate their environment or add themselves into
any global table; it's the responsibility of require() to add the module
to package.loaded, the module's luaopen_* function should just return a
value on the stack.