Another collect2.exe: error: ld returned 1 exit status

This happened to people in the past, now I am getting it after some changes.
ESP32 38 pin, GPS unit, ILI9488 TFT, BMP280 and all is ok.
Added an micro SD reader using SPI. But my reader is not attached to the regular SPI pins, so I added the following:

SPIClass spi = SPIClass(VSPI);

spi.begin(SD_SCK, SD_MISO, SD_MOSI, SD_CS);

and get the mentioned error in compile. If I comment those two lines, compile works, but then cant access the reader. All the other gpio pins are in use.
I only get the error when I open up the first of those two lines. I suppose I wouldnt need either if I could switch the lines to the default ones.

Post your full sketch. I don't use an ESP32 so can't be if much help but it will help others to help you. Also provide the additiobal board package url that you use for the ESP32.

Your topic has been moved to a more suitable location on the forum as it had nothing to do with avrdude or bootloaders.

I think we need verbose compiler output to find the error. In 'Preferences...' turn on "Show verbose output during: [X]compilation [ ]upload"

Here are the app listing and the verbose compile.
verbose_compile.zip (15.7 KB)
weather_station_display_V3.zip (6.0 KB)

TFT_eSPI_ESP32.c:17: multiple definition of `spi'; C:\Users\marty\AppData\Local\Temp\arduino_build_828589\sketch\weather_station_display_V3.ino.cpp.o:C:\Users\marty\Documents\Arduino\weather_station_display_V3/weather_station_display_V3.ino:53: first defined here
collect2.exe: error: ld returned 1 exit status

Looks like your sketch is defining a global variable named 'spi' on line 53 and the library "TFT_eSPI at version 2.4.79 in folder: C:\Users\marty\Documents\Arduino\libraries\TFT_eSPI" is ALSO defining a global named 'spi'.

I took your word about TFT_eSPI declaring spi, so I changed mine to spid and it compiled clean. Thanks for finding that.

Now you know what to do if you ever get a "multiple definition of" error in the future.

So much for a clean compile:

#include "SPI.h"
#include "SD.h"
.
#define SD_MISO 19 
#define SD_MOSI 23 
#define SD_SCK 18
#define SD_CS 5
.
SPIClass spid(VSPI); 
File myFile;
.
.
// in setup
  spid.begin(SD_SCK,SD_MISO,SD_MOSI,SD_CS);  
  if(!SD.begin(SD_CS,spid)){
    Serial.println("Card Mount Failed");
    return;
  }

and I get the failure printed.
BTW: the begin returns a zero.
By mountiƱg just the esp32 and SD reader to my breakout board and wiring accordingly, i tried many of the examples but to no avail.