lua-users home
lua-l archive

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


> In Lua 4.2 I just have to include lua.h and lualib.h. Now in must also
> include lauxlib.lib in order to have acces to lua_dofile() function and
> others. I looked in lua.h and lualib.h and there is no declaration of
> lua_dofile().
> 
> Do I have to include luaxlib.h in LUA 5.0 or did i do something wrong?

lua_dofile is deprecated. In Lua 5.0 the "primitive" operation is simply
lua_load. So you need the auxlib (and therefore luaxlib.h) to get
luaL_loadfile. The auxlib also implements the old lua_dofile, but this
is only for compatibility, and will be removed in future versions.
You should try to use luaL_loadfile (plus lua_pcall).

-- Roberto