I have declared a class as
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************************
};
But if i try defining the members like this
bool DCFrameListener::keyPressed(const OIS::KeyEvent kEvt)
{
return true;
}
The compiler refuses with this error
error C2511: 'bool DCFrameListener::keyPr开发者_如何学Goessed(const OIS::KeyEvent)' : overloaded member function not found in 'DCFrameListener'
see declaration of 'DCFrameListener'
Why is this happening, yet i declared the member keyPressed(const OIS::KeyEvent) in my function declaration.
any help will be appreciated. Thanks
The one in the declaration has a reference:
bool keyPressed(const OIS::KeyEvent & kEvt);
^!
bool DCFrameListener::keyPressed(const OIS::KeyEvent kEvt)
^?
精彩评论