Multiple undefined References , Windows 10 ; Arduino V 1.8.11 ; Arduino Uno R3

Hi Guys,

had Errors as following :

Arduino: 1.8.11 (Windows Store 1.8.28.0) (Windows 10), Board: “Arduino Uno”

C:\Users\Joscha\AppData\Local\Temp\ccftGENt.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_DisplayString.ino.cpp.o.2368’:

:(.text.startup+0x6c): undefined reference to `Elegoo_TFTLCD::Elegoo_TFTLCD(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)’

C:\Users\Joscha\AppData\Local\Temp\ccftGENt.ltrans0.ltrans.o: In function `setup’:

E:\Example02-DisplayString\DisplayString/DisplayString.ino:57: undefined reference to `Elegoo_GFX::width() const’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:57: undefined reference to `Elegoo_GFX::height() const’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:59: undefined reference to `Elegoo_TFTLCD::reset()’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:61: undefined reference to `Elegoo_TFTLCD::readID()’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:96: undefined reference to `Elegoo_TFTLCD::begin(unsigned int)’

C:\Users\Joscha\AppData\Local\Temp\ccftGENt.ltrans0.ltrans.o: In function `loop’:

E:\Example02-DisplayString\DisplayString/DisplayString.ino:102: undefined reference to `Elegoo_TFTLCD::fillScreen(unsigned int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:104: undefined reference to `Elegoo_GFX::setCursor(int, int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:106: undefined reference to `Elegoo_GFX::setTextColor(unsigned int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:106: undefined reference to `Elegoo_GFX::setTextSize(unsigned char)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:112: undefined reference to `Elegoo_GFX::setTextColor(unsigned int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:112: undefined reference to `Elegoo_GFX::setTextSize(unsigned char)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:119: undefined reference to `Elegoo_GFX::setTextColor(unsigned int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:119: undefined reference to `Elegoo_GFX::setTextSize(unsigned char)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:124: undefined reference to `Elegoo_GFX::setTextColor(unsigned int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:124: undefined reference to `Elegoo_GFX::setTextSize(unsigned char)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:126: undefined reference to `Elegoo_GFX::setTextColor(unsigned int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:126: undefined reference to `Elegoo_GFX::setTextSize(unsigned char)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:128: undefined reference to `Elegoo_GFX::setTextColor(unsigned int)’

E:\Example02-DisplayString\DisplayString/DisplayString.ino:128: undefined reference to `Elegoo_GFX::setTextSize(unsigned char)’

collect2.exe: error: ld returned 1 exit status

exit status 1
Fehler beim Kompilieren für das Board Arduino Uno.

while trying to compile the following Code

Code Start "
// IMPORTANT: ELEGOO_TFTLCD LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
// SEE RELEVANT COMMENTS IN Elegoo_TFTLCD.h FOR SETUP.
//Technical support:goodtft@163.com

#include <Elegoo_GFX.h> // Core graphics library
#include <Elegoo_TFTLCD.h> // Hardware-specific library

// The control pins for the LCD can be assigned to any digital or
// analog pins…but we’ll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0

#define LCD_RESET A4 // Can alternately just connect to Arduino’s reset pin

// When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
// For the Arduino Uno, Duemilanove, Diecimila, etc.:
// D0 connects to digital pin 8 (Notice these are
// D1 connects to digital pin 9 NOT in order!)
// D2 connects to digital pin 2
// D3 connects to digital pin 3
// D4 connects to digital pin 4
// D5 connects to digital pin 5
// D6 connects to digital pin 6
// D7 connects to digital pin 7
// For the Arduino Mega, use digital pins 22 through 29
// (on the 2-row header at the end of the board).

// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF

Elegoo_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// If using the shield, all control and data lines are fixed, and
// a simpler declaration can optionally be used:
// Elegoo_TFTLCD tft;

void setup(void) {
Serial.begin(9600);
Serial.println(F(“TFT LCD test”));

#ifdef USE_Elegoo_SHIELD_PINOUT
Serial.println(F(“Using Elegoo 2.4” TFT Arduino Shield Pinout"));
#else
Serial.println(F(“Using Elegoo 2.4” TFT Breakout Board Pinout"));
#endif

Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print(“x”); Serial.println(tft.height());

tft.reset();

uint16_t identifier = tft.readID();
if(identifier == 0x9325) {
Serial.println(F(“Found ILI9325 LCD driver”));
} else if(identifier == 0x9328) {
Serial.println(F(“Found ILI9328 LCD driver”));
} else if(identifier == 0x4535) {
Serial.println(F(“Found LGDP4535 LCD driver”));
}else if(identifier == 0x7575) {
Serial.println(F(“Found HX8347G LCD driver”));
} else if(identifier == 0x9341) {
Serial.println(F(“Found ILI9341 LCD driver”));
} else if(identifier == 0x8357) {
Serial.println(F(“Found HX8357D LCD driver”));
} else if(identifier==0x0101)
{
identifier=0x9341;
Serial.println(F(“Found 0x9341 LCD driver”));
}
else if(identifier==0x1111)
{
identifier=0x9328;
Serial.println(F(“Found 0x9328 LCD driver”));
}
else {
Serial.print(F(“Unknown LCD driver chip: “));
Serial.println(identifier, HEX);
Serial.println(F(“If using the Elegoo 2.8” TFT Arduino shield, the line:”));
Serial.println(F(” #define USE_Elegoo_SHIELD_PINOUT"));
Serial.println(F(“should appear in the library header (Elegoo_TFT.h).”));
Serial.println(F(“If using the breakout board, it should NOT be #defined!”));
Serial.println(F(“Also if using the breakout, double-check that all wiring”));
Serial.println(F(“matches the tutorial.”));
identifier=0x9328;

}
tft.begin(identifier);

}

void loop(void) {
tft.fillScreen(BLACK);
unsigned long start = micros();
tft.setCursor(0, 0);

tft.setTextColor(RED); tft.setTextSize(1);
tft.println(“Hello World!”);
tft.println(01234.56789);
tft.println(0xDEADBEEF, HEX);
tft.println();
tft.println();
tft.setTextColor(GREEN); tft.setTextSize(2);
tft.println(“Hello World!”);
tft.println(01234.56789);
tft.println(0xDEADBEEF, HEX);
tft.println();
tft.println();

tft.setTextColor(BLUE); tft.setTextSize(3);
tft.println(“Hello World!”);
tft.println(01234.56789);
tft.println(0xDEADBEEF, HEX);

tft.setTextColor(WHITE); tft.setTextSize(4);
tft.println(“Hello!”);
tft.setTextColor(YELLOW); tft.setTextSize(5);
tft.println(“Hello!”);
tft.setTextColor(RED); tft.setTextSize(6);
tft.println(“Hello!”);
tft.println();
tft.println();
/*
tft.println();
tft.setTextColor(GREEN);
tft.setTextSize(5);
tft.println(“Groop”);
tft.setTextSize(2);
tft.println(“I implore thee,”);
tft.setTextSize(1);
tft.println(“my foonting turlingdromes.”);
tft.println(“And hooptiously drangle me”);
tft.println(“with crinkly bindlewurdles,”);
tft.println(“Or I will rend thee”);
tft.println(“in the gobberwarts”);
tft.println(“with my blurglecruncheon,”);
tft.println(“see if I don’t!”);*/
delay(1000);delay(1000);delay(1000);delay(1000);delay(1000);
}
" Code Ende

This probably means you didn’t correctly install the Elegoo GFX library. You can’t just install Elegoo_GFX.h only, you need to install all the source files of the library.

Please do this:

  • (In the Arduino IDE) click File > Preferences
  • Check the box next to "Show verbose output during: > compilation
  • Click “OK”
  • Sketch > Verify/Compile
  • After the compilation fails you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the compilation output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the length of the output exceeds the forum’s 9000 character limit, save it in a .txt file and post it here as an attachment. If you click the “Reply” button you’ll see the “Attachments and other options” link.

Post a link to where you downloaded the Elegoo GFX library from.