Problems installing LuaBind
hey, friend asked me to help him with a project that we will be doing for school this year, by setting up the scripting system. We opted for Lua as the scripting system of choice, but we are unable to get it working. He recommended this site to me, so here I am!
Ok, so I downloaded Lua 1.5.1 and I compiled that as a Static library (no issues with that at all).
Then I downloaded LuaBind 0.7 I believe and I am having problems compiling that. I downloaded Boost 1.33.0 (as it recommended). I have all the paths set up right and the first time I compiled I got an error saying that LUA_NOREF was not defined. No issue, did a search, and found that it was defined in luaxlib.h. So in the file lua_include.hpp I added that include file so it now looks like
#ifndef LUA_INCLUDE_HPP_INCLUDED
#define LUA_INCLUDE_HPP_INCLUDED
extern "C"
{
#include "lua.h"
#include "lauxlib.h"
}
#endif
However, now I am getting an error in ref.cpp
c:\temp\luabind\src\ref.cpp(95) : error C2062: type 'void' unexpected
c:\temp\luabind\src\ref.cpp(96) : error C2143: syntax error : missing ';' before '{'
c:\temp\luabind\src\ref.cpp(96) : error C2447: '{' : missing function header (old-style formal list?)
c:\temp\luabind\src\ref.cpp(113) : error C2062: type 'int' unexpected
c:\temp\luabind\src\ref.cpp(114) : error C2143: syntax error : missing ';' before '{'
c:\temp\luabind\src\ref.cpp(114) : error C2447: '{' : missing function header (old-style formal list?)
c:\temp\luabind\src\ref.cpp(153) : error C2589: '(' : illegal token on right side of '::'
c:\temp\luabind\src\ref.cpp(153) : error C2059: syntax error : '::'
c:\temp\luabind\src\ref.cpp(157) : error C2589: '(' : illegal token on right side of '::'
my first thought was that something was wrong with a previous function or something like that..this is the function just before the one that gives errors
int luaL_getn (lua_State *L, int t)
{
int n;
lua_pushliteral(L, "n"); /* try t.n */
lua_rawget(L, t);
if ((n = checkint(L, 1)) >= 0) return n;
getsizes(L); /* else try sizes[t] */
lua_pushvalue(L, t);
lua_rawget(L, -2);
if ((n = checkint(L, 2)) >= 0) return n;
for (n = 1; ; n++) { /* else must count elements */
lua_rawgeti(L, t, n);
if (lua_isnil(L, -1)) break;
lua_pop(L, 1);
}
lua_pop(L, 1);
return n - 1;
}
hope any of this helps or makes any sense.
Thom
ps...if it matters visual studio 2003, and I'm trying to bulid as a static library.
If you could tell us, which Lua Version you are using, we could help. Version 1.5.1 doesn't exist.
If you use the Beta7, you have to use Lua 5.0.x. If you want to use Lua 5.1.x and higher, you must use the current CVS version from their repository.
But in your case, I would stick with lua 5.0.x
Greetings
If you use the Beta7, you have to use Lua 5.0.x. If you want to use Lua 5.1.x and higher, you must use the current CVS version from their repository.
But in your case, I would stick with lua 5.0.x
Greetings
lol! don't mind my deslexia...I ment 5.1.1. I will download 5.0.x then instead. Thanks for your help!
me
me
Does anyone have any Lua tutorials? I found some for varying versions, but now that I am forced to use 5.0, I don't have any tutorials. I especially want some that detail the C++ side of setting up/using it. Any using LuaBind would be great too!
thanks again
thanks again
All the 5.1 tutorials should work with 5.0.
Here's an example how to bind a class to lua with luabind and use it in lua: click
This tutorial is for Ogre, but it should be easy to understand. If you have understood it, you should go on reading the luabind documentation.
And here's the lua book: click Scroll down a little bit to see the content.
And google is always your friend ;)
Here's an example how to bind a class to lua with luabind and use it in lua: click
This tutorial is for Ogre, but it should be easy to understand. If you have understood it, you should go on reading the luabind documentation.
And here's the lua book: click Scroll down a little bit to see the content.
And google is always your friend ;)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement