# help with LUA (Windows)

## Recommended Posts

16bit_port    180
I just downloaded the LUA binary: lua5_2_work2_Win32_dll9_lib.zip, and I'm having trouble getting LUA to work in my application. I'm using Visual Studio .NET 2005. When I do: "lua_State * test = lua_open(0);" it says that "lua_open identifier not found". I '#include' the lua.hpp file and I do: #pragma comment( lib, "LUA\lua52.lib" ), but it still doesn't work. Any help would be great. Thanks!

##### Share on other sites
SteveDeFacto    109
Quote:
 Original post by 16bit_portI just downloaded the LUA binary: lua5_2_work2_Win32_dll9_lib.zip, and I'm having trouble getting LUA to work in my application.I'm using Visual Studio .NET 2005. When I do: "lua_State * test = lua_open(0);" it says that "lua_open identifier not found". I '#include' the lua.hpp file and I do: #pragma comment( lib, "LUA\lua52.lib" ), but it still doesn't work. Any help would be great. Thanks!

Did you add the lua lib and include directories to your compiler?

Tools
-Options...
--Project and Solutions
---VC++ Directories

##### Share on other sites
16bit_port    180
Here's what I did:

“Include files” I added “C:\Program Files\LUA\include”.
“Library files” I added “C:\Program Files\LUA”

and in my source code:

#include "lua.hpp"#pragma comment( lib, "lua52.lib" )

(Not working)

##### Share on other sites
dmail    116
lua_open was a legacy define which IIRC is removed now that 5.2 is in the works. You should instead be using luaL_newstate or lua_newstate.

##### Share on other sites
16bit_port    180
Thanks. I just went ahead and used the 5.1.4 binaries instead because 1) it's stable and 2) the tutorials I'm looking at are using lua_open.

Do you know of any tutorials for LUA that uses 5.2, dmail?

##### Share on other sites
SteveDeFacto    109
^ what he said.

##### Share on other sites
dmail    116
Quote:
 Original post by 16bit_portThanks. I just went ahead and used the 5.1.4 binaries instead because 1) it's stable and 2) the tutorials I'm looking at are using lua_open.Do you know of any tutorials for LUA that uses 5.2, dmail?

What is this LUA you speak of? Enter stage left phantom :)
Sorry no I do not know of any on line tutorials for 5.2 yet there is plenty of information on the mailing list. You may also want to check out the Lua forum which I believe is active once again.