From b577b7119aa1f57c4db7fd254c2b5b197e7451d2 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 5 Oct 2014 21:15:07 +0200 Subject: must load all symbols of a C++/Lua module, otherwise the lua_open function can't be called from the Lua VM during module initialization --- tests/tolua/libtest1/TestMod.cpp | 2 -- tests/tolua/test1.cpp | 2 -- tests/tolua/test1.lua | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/tolua/libtest1/TestMod.cpp b/tests/tolua/libtest1/TestMod.cpp index afef87a..912d652 100755 --- a/tests/tolua/libtest1/TestMod.cpp +++ b/tests/tolua/libtest1/TestMod.cpp @@ -16,8 +16,6 @@ static void initModule( void *user_data ) { LuaVM *luaVm = (LuaVM *)user_data; - cout << luaVm->handle( ) << endl; - tolua_TestMod_open( luaVm->handle( ) ); } diff --git a/tests/tolua/test1.cpp b/tests/tolua/test1.cpp index a2bff4d..902b278 100755 --- a/tests/tolua/test1.cpp +++ b/tests/tolua/test1.cpp @@ -16,8 +16,6 @@ int main( int /* argc */, char *argv[] ) LuaVM luaVm; - cout << luaVm.handle( ) << endl; - vector modules; modules.push_back( "./libtest1/mod_test.so" ); ModuleLoader loader( modules, (void *)&luaVm ); diff --git a/tests/tolua/test1.lua b/tests/tolua/test1.lua index 20d97cf..74b3852 100644 --- a/tests/tolua/test1.lua +++ b/tests/tolua/test1.lua @@ -1 +1,2 @@ local b = Derived:new( ) +b:hello( ) -- cgit v1.2.3-54-g00ecf