Advertisement

LUABind: Exporting Functions With Argument Lists

Started by July 24, 2004 08:58 AM
1 comment, last by luridcortex 20 years, 4 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
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
Advertisement
Ah yea, thats it. Found it in the docs too.

Thanks !

This topic is closed to new replies.

Advertisement