Re: [luabind] Assert thrown calling basic C++ function
Brought to you by:
arvidn,
daniel_wallin
From: Daniel W. <da...@bo...> - 2009-07-29 06:20:26
|
On 7/29/09 1:11 AM, Brian Hughes wrote: > Hello everyone, > > I’m a new user to both Lua and LuaBind, so I’m hoping I’m just making a > simple mistake in my program! I’m implanting Lua/LuaBind into an > existing codebase. > > > I’m starting by doing a very basic test of calling a global C++ function > from within a lua script. Nothing fancy, however it is throwing an > assert trying to call the function. > > > I do all of the setup (open lua state, open lua libs, open luabind), > then define my function as follows: > > luabind::module(gScriptManager->GetState()) > [ > luabind::def("sayhello", &sayhello) > ]; > > > > Where sayhello is quite basic: > > > void sayhello(void) > { > return; > } > > However, when I try to run a script that only has: sayhello() in it, > luaL_dofile returns a value of 1 (some error, which is supposedly a > YIELD error?), and when I use Decoda to debug Lua, it is throwing an > assert when it tries to call the function. Where does it assert? > I’m using Lua 5.1.4 with LuaBind 0.8.1 on MS Visual Studio 2005. How are you building luabind? It can obviously handle this basic usage, so it doesn't seem very likely it's a bug in the library. Can you supply the complete failing code (C++ and Lua) please? -- Daniel Wallin BoostPro Computing http://www.boostpro.com |