I managed to fix the problem. I added the self as an extra argument in the listener constructor and passed it as the first parameter to the callback function. -- in the script self.Callback = LuaCallback(self, self.printName) Helper.setCallback(self.Callback) ...
First, for helloworld your code works: /* file: hw.c * on Debian/Ubuntu compile with: * `gcc -I/usr/include/lua5.2 -fpic -shared -o hw.so hw.c` */ #include <lua.h> #include <lauxlib.h> struct SomethingWrapper { void *object; }; static int l_helloworld(lua_State *L) { lua_pushliteral(L, "Hello World!"); return 1; } static luaL_Reg const some_funcs[] = {...
I believe I've managed to upgrade this, so I'll add the details of what I did below and the conversion. I created a C wrapper into the LUA lower level API to export the functionality I needed: 1a) Replaced lua_settable(luaState, LUA_REGISTRYINDEX); // LUA_REGISTRYINDEX no longer accessible 1b) With lua_settablereg(luaState); 2a)...