Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • It's a typo, I've corrected it. But the error is the same. typedef void (*cba)(uint8_t, uint8_t); Commented Oct 26, 2022 at 7:48
  • It's not typo, typo means something different. if you change typedef void (*cba)(uint8_t, uint8_t, uint8_t); to typedef void (*cba)(uint8_t, uint8_t); Code wil compile without errors Commented Oct 26, 2022 at 7:50
  • updownFns[0] = updownNone; It gave: /tmp/cc3MHoSt.ltrans0.ltrans.o: In function global constructors keyed to 65535_0_app.ino.cpp.o.4201': <artificial>:(.text.startup+0x144): undefined reference to Menu::updownFns' <artificial>:(.text.startup+0x148): undefined reference to `Menu::updownFns' collect2: error: ld returned 1 exit status exit status 1 Error compiling for board Arduino Pro or Pro Mini. Commented Oct 26, 2022 at 7:51
  • 1
    There are several issue with your code. You can use like this Remove initilization from ctor and init static variable outside. MenuFunction Menu::updownFns[] = {updownNone, updownAlarmHours, updownAlarmMinutes, updownTimeHours, updownTimeMinutes }; But when you want to use updownFns it will give errors because of the function is private within this context also. Commented Oct 26, 2022 at 8:03
  • I initialized the array outside of the class definition. No errors. I then used updownFns and no errors. Commented Oct 26, 2022 at 9:17