Problem with ofxGui listener on Parameter

Hi all,
I´m having a hard time trying to add an Event Listener on a custom Class.
This is my code.

parameters.add(numLocust.set("Num Locust",1000,1, 1000));

and this is my function

void LocustManager::numLocustChanged(ofParameter p){
cout << “andandoo” << endl;

If i do the same in my ofApp class it works but whenever i try to do this on my custom class y get the following error:

…\libs\openFrameworks\types\ofParameter.h|79|error: no matching function for call to ‘ofAddListener(ofEvent&, LocustManager*&, void (LocustManager::*&)(ofParameter))’|

I believe my problem is in the parameters of the listener im adding but i can´t seem to understand how i should do it.

Thanks in advace!

Issue Solved

My “numLocusChanged” function was receiving the wrong type. This solved it:

void numLocustChanged(int &numLocust);