Two Errors with Giga Display Shield

I'm getting the following error uploading a sketch to an Arduino Giga R1 using the code below:

#include "Arduino_GigaDisplay_GFX.h"

GigaDisplay_GFX display; // create the object

#define BLACK 0x0000

void setup() {
  display.begin();
  display.fillScreen(BLACK);
  display.setCursor(10,10); //x,y
  display.setTextSize(5); //adjust text size
  display.print("Hello World!"); //print
}
void loop(){}
/Users/marcofusco/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp:402: multiple definition of `Adafruit_SPIDevice::read(unsigned char*, unsigned int, unsigned char)'
/private/var/folders/fr/z593mgld597gjz_k30hwlx8w0000gn/T/arduino/sketches/22CDDC3ABAB591F3E4F7B68C6A336145/libraries/Adafruit_BusIO/Adafruit_SPIDevice 2.cpp.o:/Users/marcofusco/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice 2.cpp:402: first defined here
/private/var/folders/fr/z593mgld597gjz_k30hwlx8w0000gn/T/arduino/sketches/22CDDC3ABAB591F3E4F7B68C6A336145/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp.o: In function `Adafruit_SPIDevice::write_then_read(unsigned char const*, unsigned int, unsigned char*, unsigned int, unsigned char)':
/Users/marcofusco/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp:440: multiple definition of `Adafruit_SPIDevice::write_then_read(unsigned char const*, unsigned int, unsigned char*, unsigned int, unsigned char)'
/private/var/folders/fr/z593mgld597gjz_k30hwlx8w0000gn/T/arduino/sketches/22CDDC3ABAB591F3E4F7B68C6A336145/libraries/Adafruit_BusIO/Adafruit_SPIDevice 2.cpp.o:/Users/marcofusco/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice 2.cpp:440: first defined here
/private/var/folders/fr/z593mgld597gjz_k30hwlx8w0000gn/T/arduino/sketches/22CDDC3ABAB591F3E4F7B68C6A336145/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp.o: In function `Adafruit_SPIDevice::write_and_read(unsigned char*, unsigned int)':
/Users/marcofusco/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp:502: multiple definition of `Adafruit_SPIDevice::write_and_read(unsigned char*, unsigned int)'
/private/var/folders/fr/z593mgld597gjz_k30hwlx8w0000gn/T/arduino/sketches/22CDDC3ABAB591F3E4F7B68C6A336145/libraries/Adafruit_BusIO/Adafruit_SPIDevice 2.cpp.o:/Users/marcofusco/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice 2.cpp:502: first defined here
collect2: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 

I tried re-installing the GFX libraries.

It uploaded once properly and this is the display:


Both the board and shield are brand new, and I tested on second Giga as well. The only thing is I originally put the LCD shield on incorrectly. Could that be why the display isn't working? Any guidance would be greatly appreciated.

Hi @mfusco. You have two copies of the Adafruit_SPIDevice.cpp file in the "Adafruit_BusIO" library.

One named Adafruit_SPIDevice.cpp:

And another named Adafruit_SPIDevice 2.cpp:

Both files are compiled when you use the library in your sketch, and since the same objects are defined in both files this causes the compilation to fail with the "multiple definition" errors.

It is my understanding that this is caused by iCloud. It only creates these file copies rarely, so it seems like maybe a glitch in the application or some corner case.

The solution is to delete the redundant copy of the file:

It would be a good idea to look at the other files in the folder to see if there are any more duplicates. You can identify the duplicates by the " 2" suffix on the filename. Delete any other duplicates you find there.

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

Hi,

Thanks for your response. I'm now getting this error:

In file included from /private/var/folders/fr/z593mgld597gjz_k30hwlx8w0000gn/T/.arduinoIDE-unsaved20241017-8911-1ids59l.nidnl/Basic/Basic.ino:1:0:
/Users/marcofusco/Documents/Arduino/libraries/Arduino_GigaDisplay_GFX/src/Arduino_GigaDisplay_GFX.h:5:10: fatal error: Arduino_H7_Video.h: No such file or directory
 #include "Arduino_H7_Video.h"
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

I'm going to ask you to provide the full verbose output from a compilation.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to fail.
  6. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  7. Open a forum reply here by clicking the "Reply" button.
  8. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  9. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  10. Move the cursor outside of the code block markup before you add any additional text to your reply.
  11. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Hi,

Thank you for your response. Attached are the errors:

Giga Error Messages.txt (288.6 KB)

OK, it is the same problem as you had in post #1, except this time it is duplicate files in the "Adafruit GFX Library".

You can use the equivalent procedure to fix it. Open the folder at the following path in Finder and delete all the files with a " 2" suffix on the filename:

/Users/marcofusco/Documents/Arduino/libraries/Adafruit_GFX_Library

After that, try compiling or uploading the sketch again. Hopefully it will finally be successful.

Hi,

Thank you. The sketches are compiling now. However, I am having an issue with one of the Giga boards. The display is shown below:

Both the board and shield are brand new. As mentioned earlier, I did connect the shield incorrectly at first. Could that have damaged the board?

Try to modify your sketch using

That works, thank you!

1 Like