lua-users home
lua-l archive

RE: Strange Errors, cannot find functions

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


> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-
> bounces@bazar2.conectiva.com.br] On Behalf Of Jérôme VUARAND
> Sent: April 8, 2007 6:58 PM
> To: Lua list
> Subject: Re: Strange Errors, cannot find functions
> 
> 2007年4月8日, Cody Harris <charris@vectec.net>:
> > extern "C"
> > {
> > #include "lua.h"
> > #include "lauxlib.h"
> > #include "lualib.h"
> > }
> >
> > int _tmain(int argc, _TCHAR* argv[])
> > {
> > lua_State* luaVM ;
> > luaVM = lua_open();
> >
> > lua_baselibopen(luaVM);
> > lua_strlibopen(luaVM);
> > lua_mathlibopen(luaVM);
> 
> In 5.x the functions to load standard libraries are named that way :
> luaopen_base, luaopen_package, luaopen_table, luaopen_io, luaopen_os,
> luaopen_string, luaopen_math, luaopen_debug.
> 
> Also with Lua 5.1 you shouldn't call them directly but instead push
> them on the stack (with lua_pushcfunction) and then call them (with
> lua_call/lua_pcall).
Is there a link you could direct me towards? I think I was using an older version. The lua site kind of confuses me. Sorry if I'm asking obvious information!
> 
> If you're using an older version someone else will have to guide you.

AltStyle によって変換されたページ (->オリジナル) /