Page 1 of 1

Using LUA

Posted: Wed Nov 12, 2008 11:10 am
by Ciidian
Hey I've got a question. I'm just starting to learn to use lua scripts now, but I am having a difficult time when I use them in a C++ project.

I think I have compiled and linked everything correctly, but I keep getting this error:
"14 C:\Dev-Cpp\main.cpp
`luaL_newstate' undeclared (first use this function)"

The only code I enter is this:

Code: Select all

  lua_State *L;
  L = lua_open();
  lua_close(L);
the error is coming up on lua_open(). Is there something I am doing wrong?

Re: Using LUA

Posted: Wed Nov 12, 2008 11:17 am
by Falco Girgis

Code: Select all

lua_State *L;
L = luaL_newstate();
lua_close(L);
Looks like you might have been trying to call a Lua 5.0 function with Lua 5.1.

Re: Using LUA

Posted: Wed Nov 12, 2008 11:21 am
by Ciidian
Thanks.. also realized I misspelled an include file name. :/