I am getting the following error when attempting to compile my sketch:
In file included from sketch.ino:24:0: SerialRenderer.h:7: error: expected class-name before '{' token
SerialRenderer.h
#ifndef SERIALRENDERER_H_
#define SERIALRENDERER_H_
#include <MenuSystem.h>
class SerialRenderer : public MenuComponentRenderer
{
public:
SerialRenderer();
virtual ~SerialRenderer();
public: // methods from MenuComponentRenderer
virtual void render(Menu const& menu) const;
virtual void render_menu_item(MenuItem const& menu_item) const;
virtual void render_back_menu_item(BackMenuItem const& menu_item) const;
virtual void render_numeric_menu_item(NumericMenuItem const& menu_item) const;
virtual void render_menu(Menu const& menu) const;
};
#endif // SERIALRENDERER_H_
The contents of MenuSystem.h can be found at https://github.com/jonblack/arduino-menusystem/blob/master/MenuSystem.h.
It seems like the include of MenuSystem.h does not happen when SerialRenderer.h is included from my main sketch file. I get the same error if the include in SerialRenderer.h is removed.
Is there something simple I am missing for the compiler to be able to "see" MenuSystem.h?
EDIT:
Turns out I was looking at a newer version of the arduino-menusystem library than I had installed (version 2.1.1). That version did not have a class called MenuComponentRenderer.
I pulled the latest version from https://github.com/jonblack/arduino-menusystem/tree/master and it compiles fine.