I'm trying to get lua 5.1 to execute a line which is just a call to one of my c++ functions "Assail" I don't understand why it does not work, can anybody point out the mistakes?
this is the Assail Function:
static int Assail(lua_State *L)
{
cout << "test" << endl;
return 1;
}
I'm trying to call do_string like this:
L = lua_open();
luaL_openlibs(L);
lua_register(L, "Assail", Assail);
luaL_dostring(L, "s = Assail()");
lua_close(L);
any help is appreciated.
luaL_dostring. Finally, note thatAssailshould probably return 0, since it does not push anything onto the stack. For a surprise, trys = Assail(10,20); print(s).