tags:

views:

65

answers:

1

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::keyPressed(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

+11  A: 

The one in the declaration has a reference:

bool keyPressed(const OIS::KeyEvent & kEvt);
                                    ^!
bool DCFrameListener::keyPressed(const OIS::KeyEvent kEvt)
                                                    ^?
GMan
Funny how the eye can gloss over such a thing.
Mark Ransom