sonyhome / SerialMenu

An Arduino library to easily create menus on the serial console.
MIT License
23 stars 12 forks source link

error: passing 'const SerialMenu' as 'this' argument discards qualifiers [-fpermissive] #2

Open DanielRIOT opened 4 years ago

DanielRIOT commented 4 years ago

Hi, I'm trying to use this library on a Arduino Zero but getting the following error when trying demo2 : Arduino IDE ver 1.8.12

seems to affect the load and getNumber methods

demo2.ino: In lambda function: demo2:39:74: error: passing 'const SerialMenu' as 'this' argument discards qualifiers [-fpermissive] {"> - Sub-menu", false, '>', [](){ menu.load(subMenu, subMenuSize); menu.show();} }

note: in call to 'void SerialMenu::load(const SerialMenuEntry, uint8_t)' inline void load(const SerialMenuEntry array, uint8_t arraySize) ^~~~

I also had to add "#include " to the hpp file or it could not find "Serial"

chkris001 commented 1 year ago

Hello, dou you solve this issue ? I have the same passing with PlatformIO/VSCode. Thank you