Event Listener Example Code Not Working

Hi I am trying to set up a basic event listener as described in the example here: http://openframeworks.cc/documentation/events/

However when I directly paste the code into my example project it produces an error:

No matching function for call to 'ofAddListener'

I have of course modified the line to work with my base class in my blank project:

ofAddListener(ofEvents().mouseMoved, this, &ofApp::mouseMoved);

The function mouseMoved() is declared as a public void in ofApp.h and the ofAddListener call is in ofApp::setup()

What is going wrong here?

Can you past the code of your .cpp and .h file?

hi @thegrinch
the parameter of the function you pass into ofAddListener has to be a reference of the same type as the event itself.
in long, read this WIP ofBook chapter
in short, ofEvents().mouseMoved is of type ofMouseEventArgs hence the function you pass to ofAddListener should be like void myFunction(ofMouseEventArgs& args)

ofApp::MouseMoved is already added as a listener, it happens behind the scenes, so no need to do so.

best!