调用"事件:<float>:通知(NULL, const double&)"没有匹配函数|
No matching function for call to ‘Event<float>::notify(NULL, const double&)’|
我在这里为我的一个程序使用框架并创建一个事件(来自这里的例子)
.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
}
相关文章:
- C++ 模板函数无法将"std:string"转换为"double"作为回报
- emplace_back和push_back给出错误'double free or corruption (fasttop)'尽管定义了复制和移动构造函数
- 调用的对象类型 'double' 不是 report() 函数的函数或函数指针
- C++ 调用析构函数后动态模板队列"double free or corruption (out)"
- 重载函数 int vs double
- 将双指针作为参数传递给需要引用 std::vector <double>的函数
- 将 std::shared_ptr<<std::vector<double>> 传递给函数
- pybind11:如何包装以 std::vector<double> 为参数以避免数据复制的 C++ 函数
- 用于检查"is int"/"is double"/等的模板函数
- 如何为包含map<int,*double>成员的类编写析构函数?
- 我可以为向量函数返回 NULL<double> 吗?
- 如何在类/类型中添加更多函数来构建 int、double、std::string 等
- 错误:调用'begin(long double [nPoints])'没有匹配函数;使用硬编码的 int 与整数变量初始化向量
- "double(*)(string, double, double)"尝试传递函数C++时"double"转换错误
- C++:无法使用条件类型在模板函数中使用 'double' 类型的 lvalue 初始化 'char*' 类型的参数
- SWIG - 如何使用采用'const double*'的构造函数将类包装为 python
- 重载的函数调用double不明确
- 有没有办法<int><double>在使用 C++11 函数调用期间自动将"向量"提升为"向量"?
- double函数仅返回-0
- c++中的Double函数