user19684: I have the following errors trying to use a TFT library function inside my library. My library uses the pointer to an instance of the TFT library in the constructor, as well described there:
Basic C++ programming, how to pass constructor argument into class?
The errors are:
error: invalid use of incomplete type 'class TFT'
_TFTscreen->background(0, 0, 0);

error: forward declaration of 'class TFT'
class TFT;

MESmenu.h:
#ifndef _MESMENU_H_
#define _MESMENU_H_

#include <SPI.h>
#include <SD.h>

class TFT;

class MESmenu{
public:
  MESmenu(TFT* pTFT) : _TFTscreen(pTFT) {};
  void start();
  void execute();
private:
  TFT* _TFTscreen;
};

#endif

MESmenu.cpp:
#include "Arduino.h"
#include "MESmenu.h"

void MESmenu::start(){
  _TFTscreen->background(0, 0, 0);
  _TFTscreen->text("starting menu...", 0, 0);
  //...
}

void MESmenu::execute(){
   //some code...  
}

The Arduino sketch is:
#include <SPI.h>
#include <SD.h>
#include <TFT.h>  // Arduino LCD library
#include <MESmenu.h>  // my library

// --------- TFT LCD ---------
// pin definition for the due
#define sd_cs  7
#define lcd_cs 10
#define dc     9
#define rst    8
TFT TFTscreen = TFT(lcd_cs, dc, rst);

// MES menu class
MESmenu *mainMenu = new MESmenu(&TFTscreen);

void setup() {
  // initialize TFT
  TFTscreen.begin();
  TFTscreen.background(0, 0, 0);
  // set the stroke color to white
  TFTscreen.stroke(255,255,255);
  TFTscreen.fill(255,255,255);
  TFTscreen.setTextSize(2);
  TFTscreen.text("TEST", 0, 0);

  // Start menu
  mainMenu->start();
}

void loop () {
  mainMenu->execute();      
}

The problem is related to the function:
_TFTscreen->background(0, 0, 0);

inside the MESmenu::start() in the .cpp file.
UPDATE:
As suggested by frarugi87 I've updated the question with the details of .h and .cpp files.
Those file are in the Arduino\libraries\MESmenu folder.
I try to change
class TFT;

with
#include <TFT.h>

and removed the #include  from the main arduino sketch.
This leads to the following errors:
libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `Adafruit_GFX::image(PImage&, unsigned int, unsigned int)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: first defined here

libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `PImage::read16(SDLib::File)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/PImage.h:17: first defined here

libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `PImage::read32(SDLib::File)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/PImage.h:17: first defined here

libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `PImage::loadImage(char const*)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/PImage.h:17: first defined here


user10214: Try to change
class TFT;

to
#include <TFT.h>

Then you can remove the #include <TFT.h> from the main arduino sketch.
Moreover you should at least write a piece of code to make the compiler include your library just once; this is the usual way to do it:
#ifndef _MESMENU_H_
#define _MESMENU_H_

#include <SPI.h>

...
the rest of your library
...

  TFT* _TFTscreen;
}

#endif

_MESMENU_H_ is any unique string (usually the filename is used, remembering that you can't put spaces or other punctuation marks except the underscore). And you should put it only in the header file (*.h or .hpp), not in the source (.c or *.cpp or *.ino)
EDIT:
The additional info lead me to analyze the library and.. there are problems with the library. Particularly the file TFT/src/utility/Adafruit_GFX.h has a big problem: it has the code for the functions.
To fix it, you have to modify the library.
Go into the folder TFT/src/utility/ and make a copy of Adafruit_GFX.h, calling it PImage.cpp.
Open Adafruit_GFX.h and delete everything between line 227 and line 370. This means that from
bool useFill;
};

#if defined(__SD_H__)  // Arduino SD library

#define BUFFPIXEL 20

void Adafruit_GFX::image(PImage & img, uint16_t x, uint16_t y) {

...

  return PImage(bmpFile, bmpWidth, bmpHeight, bmpDepth, bmpImageoffset, rowSize, flip);
}

#endif

#endif // _ADAFRUIT_GFX_H

it should become
bool useFill;
};

#endif // _ADAFRUIT_GFX_H

Having done this, open PImage.cpp and delete everything above line 227, then delete the function Adafruit_GFX::image and the last endif and add, at the beginning, #include Adafruit_GFX.h. This means that the file should look like
#include "Adafruit_GFX.h"

#if defined(__SD_H__)  // Arduino SD library

#define BUFFPIXEL 20

// These read 16- and 32-bit types from the SD card file.
// BMP data is stored little-endian, Arduino is little-endian too.
// May need to reverse subscript order if porting elsewhere.

uint16_t PImage::read16(File f) {

...  

  return PImage(bmpFile, bmpWidth, bmpHeight, bmpDepth, bmpImageoffset, rowSize, flip);
}

#endif

Then try to compile again the program
BTW: the source I looked at is at this page.

19684: <p>I have the following errors trying to use a TFT library function inside my library. My library uses the pointer to an instance of the TFT library in the constructor, as well described there:</p>

<p><a href="https://arduino.stackexchange.com/q/18974/19684">Basic C++ programming, how to pass constructor argument into class?</a></p>

<p>The errors are:</p>

<pre><code>error: invalid use of incomplete type 'class TFT'
_TFTscreen-&gt;background(0, 0, 0);

error: forward declaration of 'class TFT'
class TFT;
</code></pre>

<p><em>MESmenu.h:</em></p>

<pre><code>#ifndef _MESMENU_H_
#define _MESMENU_H_

#include &lt;SPI.h&gt;
#include &lt;SD.h&gt;

class TFT;

class MESmenu{
public:
  MESmenu(TFT* pTFT) : _TFTscreen(pTFT) {};
  void start();
  void execute();
private:
  TFT* _TFTscreen;
};

#endif
</code></pre>

<p><em>MESmenu.cpp:</em></p>

<pre><code>#include "Arduino.h"
#include "MESmenu.h"

void MESmenu::start(){
  _TFTscreen-&gt;background(0, 0, 0);
  _TFTscreen-&gt;text("starting menu...", 0, 0);
  //...
}

void MESmenu::execute(){
   //some code...  
}
</code></pre>

<p>The <em>Arduino sketch</em> is:</p>

<pre><code>#include &lt;SPI.h&gt;
#include &lt;SD.h&gt;
#include &lt;TFT.h&gt;  // Arduino LCD library
#include &lt;MESmenu.h&gt;  // my library

// --------- TFT LCD ---------
// pin definition for the due
#define sd_cs  7
#define lcd_cs 10
#define dc     9
#define rst    8
TFT TFTscreen = TFT(lcd_cs, dc, rst);

// MES menu class
MESmenu *mainMenu = new MESmenu(&amp;TFTscreen);

void setup() {
  // initialize TFT
  TFTscreen.begin();
  TFTscreen.background(0, 0, 0);
  // set the stroke color to white
  TFTscreen.stroke(255,255,255);
  TFTscreen.fill(255,255,255);
  TFTscreen.setTextSize(2);
  TFTscreen.text("TEST", 0, 0);

  // Start menu
  mainMenu-&gt;start();
}

void loop () {
  mainMenu-&gt;execute();      
}
</code></pre>

<p>The problem is related to the function:</p>

<pre><code>_TFTscreen-&gt;background(0, 0, 0);
</code></pre>

<p>inside the MESmenu::start() in the .cpp file.</p>

<p><strong>UPDATE:</strong></p>

<p>As suggested by <strong>frarugi87</strong> I've updated the question with the details of .h and .cpp files.
Those file are in the Arduino\libraries\MESmenu folder.</p>

<p>I try to change</p>

<pre><code>class TFT;
</code></pre>

<p>with</p>

<pre><code>#include &lt;TFT.h&gt;
</code></pre>

<p>and removed the #include  from the main arduino sketch.</p>

<p>This leads to the following errors:</p>

<pre><code>libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&amp;, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `Adafruit_GFX::image(PImage&amp;, unsigned int, unsigned int)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: first defined here

libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&amp;, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `PImage::read16(SDLib::File)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/PImage.h:17: first defined here

libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&amp;, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `PImage::read32(SDLib::File)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/PImage.h:17: first defined here

libraries\MESmenu\MESmenu.cpp.o: In function `Adafruit_GFX::image(PImage&amp;, unsigned int, unsigned int)':
D:\Software\arduino-1.6.7\libraries\TFT\src/utility/Adafruit_GFX.h:231: multiple definition of `PImage::loadImage(char const*)'
sketch\test_MESmenu_lib.ino.cpp.o:D:\Software\arduino-1.6.7\libraries\TFT\src/utility/PImage.h:17: first defined here
</code></pre>
 10214: <p>Try to change</p>

<pre><code>class TFT;
</code></pre>

<p>to</p>

<pre><code>#include &lt;TFT.h&gt;
</code></pre>

<p>Then you can remove the <code>#include &lt;TFT.h&gt;</code> from the main arduino sketch.</p>

<p>Moreover you should at least write a piece of code to make the compiler include your library just once; this is the usual way to do it:</p>

<pre><code>#ifndef _MESMENU_H_
#define _MESMENU_H_

#include &lt;SPI.h&gt;

...
the rest of your library
...

  TFT* _TFTscreen;
}

#endif
</code></pre>

<p><code>_MESMENU_H_</code> is any unique string (usually the filename is used, remembering that you can't put spaces or other punctuation marks except the underscore). And you should put it only in the header file (*.h or <em>.hpp), not in the source (</em>.c or *.cpp or *.ino)</p>

<p>EDIT:</p>

<p>The additional info lead me to analyze the library and.. there are problems with the library. Particularly the file <code>TFT/src/utility/Adafruit_GFX.h</code> has a big problem: it has the code for the functions.</p>

<p>To fix it, you have to modify the library.</p>

<p>Go into the folder <code>TFT/src/utility/</code> and make a copy of <code>Adafruit_GFX.h</code>, calling it <code>PImage.cpp</code>.</p>

<p>Open <code>Adafruit_GFX.h</code> and delete everything between line 227 and line 370. This means that from</p>

<pre><code>bool useFill;
};

#if defined(__SD_H__)  // Arduino SD library

#define BUFFPIXEL 20

void Adafruit_GFX::image(PImage &amp; img, uint16_t x, uint16_t y) {

...

  return PImage(bmpFile, bmpWidth, bmpHeight, bmpDepth, bmpImageoffset, rowSize, flip);
}

#endif

#endif // _ADAFRUIT_GFX_H
</code></pre>

<p>it should become</p>

<pre><code>bool useFill;
};

#endif // _ADAFRUIT_GFX_H
</code></pre>

<p>Having done this, open <code>PImage.cpp</code> and delete everything above line 227, then delete the function <code>Adafruit_GFX::image</code> and the last <code>endif</code> and add, at the beginning, <code>#include Adafruit_GFX.h</code>. This means that the file should look like</p>

<pre><code>#include "Adafruit_GFX.h"

#if defined(__SD_H__)  // Arduino SD library

#define BUFFPIXEL 20

// These read 16- and 32-bit types from the SD card file.
// BMP data is stored little-endian, Arduino is little-endian too.
// May need to reverse subscript order if porting elsewhere.

uint16_t PImage::read16(File f) {

...  

  return PImage(bmpFile, bmpWidth, bmpHeight, bmpDepth, bmpImageoffset, rowSize, flip);
}

#endif
</code></pre>

<p>Then try to compile again the program</p>

<p>BTW: the source I looked at is at <a href="http://bitsbytesnibble.com/indefero/p/builduinok5/source/tree/master/libraries/TFT/src/utility/Adafruit_GFX.h" rel="nofollow">this page</a>.</p>
