2022-03-24 02:04 PM
Code works fine in simulator but compilation to target (STM32756G-eval2).
Code:
// MainDisplayView.cpp
MainDisplayView::MainDisplayView():
viewCallback(this, &MainDisplayView::buttonNavCallbackHandler),
boxClickedCallback1(this, &MainDisplayView::boxClickedHandler1),
boxClickedCallback2(this, &MainDisplayView::boxClickedHandler2)
{
buttonLeft.setViewCallback(viewCallback);
buttonRight.setViewCallback(viewCallback);
overtempSetting1.setClickAction(boxClickedCallback1);
durationSetting1.setClickAction(boxClickedCallback2);
}
Error:
TouchGFX/gui/src/maindisplay_screen/MainDisplayView.cpp: In constructor
'MainDisplayView::MainDisplayView()':
TouchGFX/gui/src/maindisplay_screen/MainDisplayView.cpp:10:71: error: invalid use of non-static member function 'void MainDisplayView::buttonNavCallbackHandler(const buttonImportant&)'
boxClickedCallback2(this, &MainDisplayView::boxClickedHandler2)
^
In file included from TouchGFX/gui/src/maindisplay_screen/MainDisplayView.cpp:1:0: TouchGFX/gui/include/gui/maindisplay_screen/MainDisplayView.hpp:60:10: note: declared here void
buttonNavCallbackHandler(const buttonImportant &b);
^~~~~~~~~~~~~~~~~~~~~~~~
gcc/Makefile:320: recipe for target 'TouchGFX/build/STM32756G-EVAL/TouchGFX/gui/src/maindisplay_screen/MainDisplayView.o' failed
Particularly the error "invalid use of non-static member function" is what is puzzling me. My callbacks are setup how they should be. Any help would be appreciated.