Skip to content

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

@DanielRIOT

Description

@DanielRIOT

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 <Arduino.h>" to the hpp file or it could not find "Serial"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions