开发者

problems with overloaded function members C++

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)
                                                    ^?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜