我已经宣布一个班为
class DCFrameListener : public FrameListener, public OIS::MouseListener, public OIS::KeyListener
{
bool keyPressed(const OIS::KeyEvent & kEvt);
bool keyReleased(const OIS::KeyEvent &kEvt);
//*******some code missing************************
};
但是如果我试着这样定义成员
bool DCFrameListener::keyPressed(const OIS::KeyEvent kEvt)
{
return true;
}
编译器拒绝出现此错误
error C2511: 'bool DCFrameListener::keyPressed(const OIS::KeyEvent)' : overloaded member function not found in 'DCFrameListener'
see declaration of 'DCFrameListener'
为什么会这样,但我宣布
按键(const ois::keyEvent)
在我的函数声明中。
任何帮助都将不胜感激。谢谢