Original Post
Hello,
I am new to Lua and when I run the following code, I always get the same errormessage saying: "test.lua:1: unexpected symbol near '' '' ".. Am I forgeting something?.. Here is my samplecode:
#include <iostream.h>
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <luabind/luabind.hpp>
using namespace luabind;
class CTest
{
public:
CTest(){};
void Boo(){ cout << "LLaP"; }
};
int main( int argc , char* argv [])
{
lua_State* luaVM = lua_open();
luabind::open( luaVM);
module( luaVM)
[
class_("Test")
.def(constructor<>())
.def("Boo", &CTest::Boo)
];
lua_dofile( luaVM, "test.lua");
lua_close( luaVM);
cin.get();
return 0;
}
*----- test.lua -----*
T = Test()
T:Boo()