Using LUA

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Ciidian
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 14
Joined: Mon Nov 03, 2008 4:59 pm

Using LUA

Post 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?
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Using LUA

Post 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.
Ciidian
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 14
Joined: Mon Nov 03, 2008 4:59 pm

Re: Using LUA

Post by Ciidian »

Thanks.. also realized I misspelled an include file name. :/
Post Reply