Lua bind function call (compile fine but getting runtime exception Access violation - no RTTI data!)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua bind function call (compile fine but getting runtime exception Access violation - no RTTI data!)

deshanc
Hello
I am quite new to lua.
I am trying to bind a oggsound library to lua. Everythings compile fine, but run time i am getting an error.

This is how I bind classes
----------------------------------------------------------------------------------------------------------------------------------------------
                 
                 // binding OgreOggSoundManager class with overloaded function createsound
                 luabind::module(myLuaState) [
luabind::class_<OgreOggSoundManager>("OgreOggSoundManager")
.def("createSound", (OgreOggISound*(OgreOggSoundManager::*)(const std::string&,const std::string&, bool, bool, bool))
&OgreOggSoundManager::createSound)
];

                // binding OgreOggISound class
luabind::module(myLuaState) [
luabind::class_<OgreOggISound>("OgreOggISound")
];


This is the createsound method in OgreOggSoundManager class
----------------------------------------------------------------------------------------------------------------------------------------------

OgreOggISound* createSound
 (const std::string& name,
   const std::string& file,
   bool stream = false,
   bool loop = false,
   bool preBuffer=false);


This is how I call loadGame1OceanSound function in script
----------------------------------------------------------------------------------------------------------------------------------------------

OgreOggISound game1StateOceanSound = NULL;
luabind::call_function<int>(myLuaState, "loadGame1OceanSound", OgreOggSoundManager::getSingletonPtr(), game1StateOceanSound);


This is script
----------------------------------------------------------------------------------------------------------------------------------------------

function loadGame1OceanSound(manager, sound)
name = "GAME_1_BACKGROUND_OCEAN_SOUND";
sFile = "SEA.wav";
sound = manager:createSound(name, sFile, false, true, false);
return 0;
end

What am I doing wrong?

Thank you in advance


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Lua bind function call (compile fine but getting runtime exception Access violation - no RTTI data!)

James Porter-2
On 7/15/2010 2:01 PM, chamika deshan wrote:
> Hello
> I am quite new to lua.
> I am trying to bind a oggsound library to lua. Everythings compile fine,
> but run time i am getting an error.
[snip]
> What am I doing wrong?

Are you compiling with RTTI disabled? That's what the error looks like
to me.

- Jim


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user