🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

LUABind: Exporting Derived Classes

Started by
-1 comments, last by luridcortex 19 years, 11 months ago
Having a bit of trouble with this one as well. I have a class CUnit that Derives from CEntity. While exportting methods that CUnit derives from CEnity i get lots of errors: c:\Programming\lib\luabind\luabind\class.hpp(229): error C2782: 'int luabind::detail::call(R (__thiscall T::* )(A0) const,T *,lua_State *,const Policies *)' : template parameter 'T' is ambiguous c:\Programming\lib\luabind\luabind\class.hpp(229): error C2782: 'int luabind::detail::call(R (__thiscall T::* )(A0),T *,lua_State *,const Policies *)' : template parameter 'T' is ambiguous c:\Programming\lib\luabind\luabind\class.hpp(229): error C2784: 'int luabind::detail::call(R (__cdecl *)(const T &,A0),T *,lua_State *,const Policies *)' : could not deduce template argument for 'T3 (__cdecl *)(const T1 &,T4)' from 'void (__thiscall CEntity::* )(float)' c:\Programming\lib\luabind\luabind\class.hpp(229): error C2784: 'int luabind::detail::call(R (__cdecl *)(const T &),T *,lua_State *,const Policies *)' : could not deduce template argument for 'T3 (__cdecl *)(const T1 &)' from 'void (__thiscall CEntity::* )(float)' c:\Programming\lib\luabind\luabind\class.hpp(229): error C2784: 'int luabind::detail::call(R (__cdecl *)(const T &,A0,A1),T *,lua_State *,const Policies *)' : could not deduce template argument for 'T3 (__cdecl *)(const T1 &,T4,T5)' from 'void (__thiscall CEntity::* )(float)' c:\Programming\lib\luabind\luabind\class.hpp(229): error C2784: 'int luabind::detail::call(R (__cdecl *)(const T &,A0,A1,A2),T *,lua_State *,const Policies *)' : could not deduce template argument for 'T3 (__cdecl *)(const T1 &,T4,T5,T6)' from 'void (__thiscall CEntity::* )(float)' ... and on and on. In this case i have a function SetXPos() in CEntity that CUnit derives. I try and export the method like so:

module ( pScriptManager->GetLuaState ( ) )
[
		class_<CUnit, CEntity>("CUnit")
			
			.def(constructor<int>())
			.def("SetHitPoints",    &CUnit::SetHitPoints  )
			.def("SetInitiative",   &CUnit::SetInitiative )
			.def("SetMovementRate", &CUnit::SetHitPoints  )
			.def("SetXPos",         &CUnit::SetX          )
];
Attempting to export CUnit::SetX produces the above errors... Any help? Thanks! -gf

This topic is closed to new replies.

Advertisement