我正在使用openframeworks。这是基于C++的。C++:无法使用类型为'void'的右值初始化类型为'guiBaseObject *'的变量
我有以下代码:
guiBaseObject *item = panel.addSlider("motor_speed", 0, 0, 100);
而且我无法理解为什么我收到以下错误。
/Users/CREATER/Documents/of_v0.8.4_osx_release/apps/myApps/MapamokStepper/src/MotorControl.cpp:38:20: Cannot initialize a variable of type 'guiBaseObject *' with an rvalue of type 'void'
'addSlider'可能返回'void',所以你不能在'guiBaseObject *'从它返回。 – CoryKramer
'addSlider()'的返回类型是什么? – Biffen
我的文档中没有看到['addSlider'](http://openframeworks.cc/documentation/),但我认为它会返回'void'。 – CoryKramer