我有一类人想受lu。 减少的法典可以是:
class CSprite2D{
void setPosition(glm::ivec2 val) { m_position = val; }
void setPosition(int posX, int posY) { m_position.x = posX; m_position.y = posY; }
static void exposeAPI(lua_State* L,const unsigned char* data)
{
assert(L);
luabind::module(L)[
luabind::class_<CSprite2D>("CSprite2D")
.def("setPosition",(void(*)(int,int))&CSprite2D::setPosition)
];
}
在我试图汇编时,编辑们 throw倒和错误:
Error 1 error C2440: type cast : cannot convert from overloaded-function to void (__cdecl *)(int,int) c:directogameprojects2008zeleste2dsrcgraphicsgpxsprite2d.cpp 74
Error 2 error C2780: luabind::class_<T> &luabind::class_<T>::def(luabind::detail::operator_<Derived>) : expects 1 arguments - 2 provided c:directogameprojects2008zeleste2dsrcgraphicsgpxsprite2d.cpp 74
Error 3 error C2784: luabind::class_<T> &luabind::class_<T>::def(luabind::detail::operator_<Derived>,const Policies &) : could not deduce template argument for luabind::detail::operator_<Derived> from const char [12] c:directogameprojects2008zeleste2dsrcgraphicsgpxsprite2d.cpp 74
Error 4 error C2784: luabind::class_<T> &luabind::class_<T>::def(luabind::constructor<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9>,const Policies &) : could not deduce template argument for luabind::constructor<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9> from const char [12] c:directogameprojects2008zeleste2dsrcgraphicsgpxsprite2d.cpp 74
Error 5 error C2780: luabind::class_<T> &luabind::class_<T>::def(luabind::constructor<A0,A1,A2,A3,A4,A5,A6,A7,A8,A9>) : expects 1 arguments - 2 provided c:directogameprojects2008zeleste2dsrcgraphicsgpxsprite2d.cpp 74
Error 6 error C2780: luabind::class_<T> &luabind::class_<T>::def(const char *,F,Default,const Policies &) : expects 4 arguments - 2 provided c:directogameprojects2008zeleste2dsrcgraphicsgpxsprite2d.cpp 74
Error 7 error C2780: luabind::class_<T> &luabind::class_<T>::def(const char *,F,DefaultOrPolicies) : expects 3 arguments - 2 provided c:directogameprojects2008zeleste2dsrcgraphicsgpxsprite2d.cpp 74
我知道,造成这一问题的原因是,旋转的罐头推卸了最好的超负荷功能,但reading the luabind documentation I m 正确地界定了该功能。
任何想法?
预 收