Compilation fails: "Arduino_GigaDisplay_GFX.h: No such file or directory"

Continuing the discussion from Arduino H7 Video Header File Missing:

Hi, I'm having the same issues but I actually have the Giga R1 and I believe I have everything I need to have installed. Full Disclosure : Novice user. I'm getting this and other errors as well on more than have of the example sketches. Any help is appreciated

Please read a forum guide How to get the best out of this forum

Please insert your full code and entire error message, using a code tags.

Thank you!

Error: C:\Users\12146\AppData\Local\Temp.arduinoIDE-unsaved202523-25160-jz0k8u.548rq\sketch_mar3a\sketch_mar3a.ino:1:10: fatal error: Arduino_GigaDisplay_GFX.h: No such file or directory
#include "Arduino_GigaDisplay_GFX.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: Arduino_GigaDisplay_GFX.h: No such file or directory

#include "Arduino_GigaDisplay_GFX.h"
#include "Arduino_GigaDisplayTouch.h"
#include "Arduino_LED_Matrix.h"

GigaDisplay_GFX display;
Arduino_GigaDisplayTouch touch;
ArduinoLEDMatrix matrix;

#define PALETTE_X 50
#define PALETTE_Y 50
#define PALETTE_WIDTH 700
#define PALETTE_HEIGHT 300

void setup() {
  display.begin();
  touch.begin();
  matrix.begin();
  
  drawColorPalette();
  drawInterface();
}

void loop() {
  if (touch.available()) {
    uint16_t x, y;
    touch.getPosition(x, y);
    
    if (x >= PALETTE_X && x < PALETTE_X + PALETTE_WIDTH &&
        y >= PALETTE_Y && y < PALETTE_Y + PALETTE_HEIGHT) {
      uint16_t color = getColorAtPosition(x, y);
      updateSelectedColor(color);
    }
  }
}

void drawColorPalette() {
  for (int x = 0; x < PALETTE_WIDTH; x++) {
    for (int y = 0; y < PALETTE_HEIGHT; y++) {
      uint8_t r = map(x, 0, PALETTE_WIDTH, 0, 255);
      uint8_t g = map(y, 0, PALETTE_HEIGHT, 0, 255);
      uint8_t b = 128;
      uint16_t color = display.color565(r, g, b);
      display.drawPixel(PALETTE_X + x, PALETTE_Y + y, color);
    }
  }
}

void drawInterface() {
  display.setTextColor(0xFFFF);
  display.setTextSize(2);
  display.setCursor(50, 400);
  display.print("Touch the palette to select a color");
}

uint16_t getColorAtPosition(uint16_t x, uint16_t y) {
  uint8_t r = map(x - PALETTE_X, 0, PALETTE_WIDTH, 0, 255);
  uint8_t g = map(y - PALETTE_Y, 0, PALETTE_HEIGHT, 0, 255);
  uint8_t b = 128;
  return display.color565(r, g, b);
}

void updateSelectedColor(uint16_t color) {
  uint8_t r = (color >> 11) << 3;
  uint8_t g = ((color >> 5) & 0x3F) << 2;
  uint8_t b = (color & 0x1F) << 3;
  
  display.fillRect(300, 420, 200, 50, color);
  display.setTextColor(0xFFFF);
  display.setCursor(300, 480);
  display.print("R: ");
  display.print(r);
  display.print(" G: ");
  display.print(g);
  display.print(" B: ");
  display.print(b);
  
  matrix.beginDraw();
  matrix.drawPixel(0, 0, r, g, b);
  matrix.endDraw();
}

Hi @joeymakesstuff.

When you see a "No such file or directory" error like this, it almost always means you need to install the library that contains the missing file.

You can usually use the Arduino IDE Library Manager to install the library. I'll provide instructions you can follow to do that:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. Type Arduino_GigaDisplay_GFX in the "Filter your search..." field.
  3. Find the "Arduino_GigaDisplay_GFX" entry in the list of search results.
  4. You will see an "INSTALL" button at the bottom of the entry. Click the button.
    An "Install library dependencies" dialog will open.
  5. Click the "INSTALL ALL" button in the "Install library dependencies" dialog.
    The dialog will close.
  6. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully installed library ...

After that, try compiling or uploading your sketch again. Hopefully this time it will be successful.

Thank you, I think maybe one of the problems was I didn't have all the dependencies installed because I did in fact have "Arduino_GigaDisplay_GFX " installed. I uninstalled and reinstalled and now I'm getting the following error on the same sketch: "C:\Users\12146\AppData\Local\Temp.arduinoIDE-unsaved202523-25160-jz0k8u.548rq\sketch_mar3a\sketch_mar3a.ino:3:10: fatal error: Arduino_LED_Matrix.h: No such file or directory
#include "Arduino_LED_Matrix.h"
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: Arduino_LED_Matrix.h: No such file or directory

This is progress!

The situation is different with the "Arduino_LED_Matrix" library than it was with the "Arduino_GigaDisplay_GFX". The "Arduino_LED_Matrix" library is written specifically for use with the UNO R4 WiFi (which has a built-in LED matrix). For this reason, the library is bundled with the Arduino boards platform that adds support to Arduino IDE for the UNO R4 WiFi board. For this reason, you can't install that library via Library Manager.

It also doesn't really make sense to try to use that library with the GIGA R1 WiFi board, because the GIGA R1 WiFi doesn't have an LED matrix.

Similarly, it doesn't really make sense to use libraries like "Arduino_GigaDisplay_GFX" in the same sketch as the "Arduino_LED_Matrix" library since the GIGA Display Shield is specifically designed to be used with the headers on the GIGA R1 WiFi board which are not present on the UNO R4 WiFi (it is theoretically possible to use GIGA Display Shield with UNO R4 WiFi, but it would not be a convenient "plug and play" operation as it is with the GIGA R1 WiFi).

So I'm quite confused by your sketch code.

Did you write this code yourself, or did you find it somewhere on the Internet? If you found it on the Internet, please provide a link to where you found it.

Do you have an LED matrix connected to your GIGA R1 WiFi board?