[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Strange Errors, cannot find functions
- From: "Jérôme VUARAND" <jerome.vuarand@...>
- Date: Sun, 8 Apr 2007 17:58:08 -0400
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).
If you're using an older version someone else will have to guide you.