Include Adafruit_RGB LCD Shield library in class I'm trying to make a class to expand on the functionality of the Adafruit-RGB-LCD-Shield-Library I'm creating this based on what I see from this post.
class LcdMenu
{
 #include &lt;Adafruit_MCP23017.h&gt;
 #include &lt;Adafruit_RGBLCDShield.h&gt;
 public:      
 Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
     void Setup()
     {
      lcd.begin(16, 2);
     }
     void Write(int line, char text[17])
     {
      lcd.clear();
     }
};

LcdMenu *LcdM;
#define VIOLET 0x5 

void setup()
{
  LcdM-&gt;Setup();
  LcdM-&gt;lcd.setBacklight(VIOLET);
}

However, I'm getting the following error:

C:\Users\jschere2\AppData\Local\Temp\ccUzvCmX.ltrans0.ltrans.o: In function `main':
ccUzvCmX.ltrans0.o:(.text.startup+0xf0): undefined reference to `LcdMenu::Adafruit_RGBLCDShield::begin(unsigned char, unsigned char, unsigned char)'
ccUzvCmX.ltrans0.o:(.text.startup+0xf8): undefined reference to `LcdMenu::Adafruit_RGBLCDShield::setBacklight(unsigned char)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
Move your #include statements outside the class definition.

You declare a pointer, but never allocate space for it with new. I see no need for a pointer.

#include &lt;Adafruit_MCP23017.h&gt;
#include &lt;Adafruit_RGBLCDShield.h&gt;

class LcdMenu
{
 public:
     // default ctor will be called here.
     Adafruit_RGBLCDShield lcd;

     void Setup()
     {
      lcd.begin(16, 2);
     }
     void Write(int line, char text[17])
     {
      lcd.clear();
     }
};

LcdMenu LcdM;
#define VIOLET 0x5 

void setup()
{
  LcdM.Setup();
  LcdM.lcd.setBacklight(VIOLET);
}


Also note: you are not extending the Adafruit_RGBLCDShield class as in the example you linked. To do that:

#include &lt;Adafruit_MCP23017.h&gt;
#include &lt;Adafruit_RGBLCDShield.h&gt;

class LcdMenu : public Adafruit_RGBLCDShield
{
 public:
     void Setup()
     {
      begin(16, 2);
     }
     void Write(int line, char text[17])
     {
      clear();
     }
};

LcdMenu LcdM;
#define VIOLET 0x5 

void setup()
{
  LcdM.Setup();
  LcdM.setBacklight(VIOLET);
}