调用"事件:<float>:通知(NULL, const double&)"没有匹配函数|

No matching function for call to ‘Event<float>::notify(NULL, const double&)’|

本文关键字:double 函数 const float lt 事件 gt 通知 NULL 调用      更新时间:2023-10-16

我在这里为我的一个程序使用框架并创建一个事件(来自这里的例子)

.h 文件

ofEvent<float> onVolumeChange

.cpp文件

//main method()
ofAddListener(onVolumeChange, this, &MainProgram::handleVolumeChange);
//kePrees method
if(key== ' '){
ofNotifyEvent(onVolumeChange, 10.0f);
}

我在尝试构建它时遇到编译错误,这似乎很奇怪,因为我只是遵循已经存在的示例。

我在这里得到的错误是:

No matching function for call to ‘ofEvent<float>::notify(NULL, const float&)’|

如果需要,关于我的机器:Ubuntu 12.04,Codeblocks,C++/openFrameworks

我在这里缺少什么?

MainProgram 类应该有:

void MainProgram::handleVolumeChange(float& variable){
    //handler
}