🎉 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 Functions With Argument Lists

Started by
1 comment, last by luridcortex 19 years, 11 months ago
I am trying to export a class method and am getting a stange error, here is the code:

module ( pScriptManager->GetLuaState ( ) )
	[
		class_<CUnitManager>("CUnitManager")
			.def( "AddUnit", &CUnitManager::AddUnit)

		class_<CUnit>("CUnit")
			.def(constructor<int>())
			.def("Set", &CUnit::Set)
	];
.def("Set", &CUnit::Set) is the function that it seems to have a problem with, here is its prototype:

// Set ( )
		//
		// Sets up a units main attributes
		void Set ( float pX, float pY, int pState, int pHitPoints, int pInitiative, int pMovementRate );
And heres the error message: c:\Programming\lib\luabind\luabind\class.hpp(1066): error C2660: 'luabind::detail::overload_rep::overload_rep' : function does not take 2 arguments The error falls in the file class.hpp thanks! -gf
Advertisement
You might not have Luabind's arity set high enough. It's a preprocessor #define that sets how many arguments you are allowed--increasing it also increases your compile time. Look in luabind/config.hpp
Ah yea, thats it. Found it in the docs too.

Thanks !

This topic is closed to new replies.

Advertisement