[Solved] Compiling error for Adafruit TFTLCD library

I’ve recently been having a compiling error that I suspect is a fault with the library, and am wondering if anyone else has had this trouble. I noticed this problem only today, when trying to compile a sketch I’ve been working on. I tried an older test sketch (attached) that I know works from previously, and received the same error:

Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all
D:\allen\Documents\Arduino\libraries\TFTLCD-Library-master\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::init()':

D:\allen\Documents\Arduino\libraries\TFTLCD-Library-master\Adafruit_TFTLCD.cpp:115:3: error: 'textsize' was not declared in this scope

   textsize = 1;


exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

It all seems to relate to the TFTLCD library:

which had been working previously. I’ve tried reinstalling the library, but with no success.
The screen I’m using is an Elegoo 2.8 TFTLCD touch screen. It comes with it’s own library in the provided CD, but as another user pointed out, it’s just the Adafruit library with some name changes. I changed my sketch back to use the Elegoo library instead, and it worked. The sketch was working just fine with the Adafruit library, and nothing in that regard was changed to the sketch. Is this a library issue, or something with my code?

Thank you for any help.

dash_02.ino (9.59 KB)

The 1.5.4 release of the Adafruit_GFX broke compatibility with the Adafruit_TFTLCD library. You'll need to roll back to Adafruit_GFX 1.5.3:

  • Sketch > Include Library > Manage Libraries
  • Wait for the download to finish
  • In the "Filter your search..." box, type "adafruit_gfx".
  • Press Enter.
  • From the search results, click on "Adafruit GFX Library by Adafruit".
  • From the dropdown version menu, select 1.5.3.
  • Click the "Install" button.
  • Wait for the installation to finish.
  • Click the "Close" button.

After that, the sketch should compile.

If you have updatable library notifications enabled in the Arduino IDE, it will occasionally prompt you to update your Adafruit_GFX library to the new version. You will need to refrain from doing so, otherwise you'll be back to the same compilation error again when you use the Adafruit_TFTLCD library.

Ah, I knew the GFX updated, but didn't know it would cause the TFT to break. Thanks, I'll roll it back.