[Adafruit-GFX-Library] Internal compiler error: Segmentation fault

Hello,

I try to use the library Adafruit-GFX-Library in order to use the TFT 2.2 Inch LCD device, but I always have this error message:

Arduino : 1.8.7 (Windows Store 1.8.15.0) (Windows 10), Carte : "Arduino/Genuino Uno"

C:\Users\COCALE~1\AppData\Local\Temp\ccr6Lj1q.ltrans0.ltrans.o: In function `main':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1
Erreur de compilation pour la carte Arduino/Genuino Uno

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.

Here, the sketch (Part of Adafruit-GFX-Library/graphictest exemple):

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.
#define TFT_RESET 8
#define TFT_DC 9
#define TFT_CS 10

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RESET);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

How can I fix it please ?

PS: I am using:

  • Arduino IDE 1.8.7
  • Arduino Uno card
  • cf. screenshot for connection (do not know how ton integrate image here)

The title of the thread doesn't match the actual error you're getting:

Cocalera:

[code]
C:\Users\COCALE~1\AppData\Local\Temp\ccr6Lj1q.ltrans0.ltrans.o: In function `main':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

[/code]

Every sketch must have a setup() and loop() function, even if you leave them empty. Since your sketch doesn't have a setup() or loop(), you get a compilation error.

If you do encounter a segmentation fault error, that is caused by something completely different and I can also help you with that problem.