[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Strange Errors, cannot find functions
- From: "Cody Harris" <charris@...>
- Date: Sun, 8 Apr 2007 23:51:07 -0300
> -----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.