Problem with uno on IDE 2 beta

what is this error:
c:/users/mahdi/appdata/local/arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
Compilation error: Error: 2 UNKNOWN: exit status 1

I saw this error just in v2 beta IDE

Hi @mahdibaseri. Thanks for giving the beta phase Arduino IDE 2.x a try!

Please try this:

  1. Select File > New from the Arduino IDE's menus.
  2. Select Sketch > Verify/Compile from the Arduino IDE's menus.

Does the same error occur?

The reason for this procedure is to determine whether the problem is specific to the sketch you were compiling before. If the error still occurs with the File > New sketch, we'll know that it is not at all related to the specific sketch you were compiling.

again i have that error

I was looking for somebody having this kind of error but it seems that my case is a bit different.
The error message at the end of the failing compilation is almost the same : "collect2: error: ld returned 1 exit status". As you can se it says "collect", not "collect.exe".
However the main difference is that I retrieved two old sketches that compiled under IDE 1 and they still compile under IDE 2. The new sketch I'm working on, fairly complex, it's an Internet Radio on ESP32, ends the compilation with that error message.
I did a last test. I've loaded this latter sketch under IDE 1 and it doesn't compile as well. It ends with the same error message. Root of the error's cause are, at least to me, incomprehensible.
I hope this may help debugging the IDE 2 and help me as well. Thank you

Hi @mahdibaseri and @Fabri54.
I'm going to ask you to post some additional information that might help us to identify the problem.

Please do this:

  1. Select File > Preferences from the Arduino IDE's menus.
  2. Check the box next to "Show verbose output during: compilation".
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE's menus.
  5. Wait for the compilation to end.
  6. Right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
  7. From the context menu, click Copy All.
  8. Open a forum reply here by clicking the Reply button.
  9. Click the </> 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.
    Code block
  10. Press Ctrl+V. This will paste the compilation output into the code block.
  11. Move the cursor outside of the code tags before you add any additional text to your reply.
  12. Click the Reply button to post the output.

I've tried a few things, today, and here are my findings: Two sketches that compiled under IDE 1 do not compile under 1 any more, neither under IDE 2. Both use Adafruit_GFX and Adafruit_SSD1306 libraries.
I've to admit that I did a stupid thing, not only I've installed IDE 2 but I've also installed IDE 1.8.15 Hourly Build 2021/05/19 12:35.
The error message is at linking time. All before looks OK and I just copied and pasted what follows:

Linking everything together...
/Users/fabriziobianchi/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-gcc -nostdlib -L/Users/fabriziobianchi/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/lib -L/Users/fabriziobianchi/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/ld -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u esp_app_desc -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -Wl,--start-group /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/sketch/OLED_featherwing.ino.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/SPI/SPI.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Wire/Wire.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/glcdfont.c.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GFX.cpp.o "/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o" /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_BusIO/Adafruit_BusIO_Register.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp.o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-core-cache/core_6a12163587d12953fe494fe5f29ea1de.a -lgcc -lesp_websocket_client -lwpa2 -ldetection -lesp_https_server -lwps -lhal -lconsole -lpe -lsoc -lsdmmc -lpthread -llog -lesp_http_client -ljson -lmesh -lesp32-camera -lnet80211 -lwpa_supplicant -lc -lmqtt -lcxx -lesp_https_ota -lulp -lefuse -lpp -lmdns -lbt -lwpa -lspiffs -lheap -limage_util -lunity -lrtc -lmbedtls -lface_recognition -lnghttp -ljsmn -lopenssl -lcore -lfatfs -lm -lprotocomm -lsmartconfig -lxtensa-debug-module -ldl -lesp_event -lesp-tls -lfd -lespcoredump -lesp_http_server -lfr -lsmartconfig_ack -lwear_levelling -ltcp_transport -llwip -lphy -lvfs -lcoap -lesp32 -llibsodium -lbootloader_support -ldriver -lcoexist -lasio -lod -lmicro-ecc -lesp_ringbuf -ldetection_cat_face -lapp_update -lespnow -lface_detection -lapp_trace -lnewlib -lbtdm_app -lwifi_provisioning -lfreertos -lfreemodbus -lethernet -lnvs_flash -lspi_flash -lc_nano -lexpat -lfb_gfx -lprotobuf-c -lesp_adc_cal -ltcpip_adapter -lstdc++ -lc-psram-workaround -lm-psram-workaround -Wl,--end-group -Wl,-EL -o /var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/OLED_featherwing.ino.elf
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::drawPixel(short, short, unsigned short)':
/Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp:284: multiple definition of `Adafruit_GrayOLED::drawPixel(short, short, unsigned short)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:/Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp:284: first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, TwoWire*, signed char, unsigned int, unsigned int)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP7TwoWireajj+0x0): multiple definition of `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, TwoWire*, signed char, unsigned int, unsigned int)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP7TwoWireajj+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, TwoWire*, signed char, unsigned int, unsigned int)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP7TwoWireajj+0x0): multiple definition of `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, TwoWire*, signed char, unsigned int, unsigned int)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP7TwoWireajj+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, signed char, signed char, signed char, signed char, signed char)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDC2Ehttaaaaa+0x0): multiple definition of `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, signed char, signed char, signed char, signed char, signed char)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDC2Ehttaaaaa+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, signed char, signed char, signed char, signed char, signed char)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDC2Ehttaaaaa+0x0): multiple definition of `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, signed char, signed char, signed char, signed char, signed char)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDC2Ehttaaaaa+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, SPIClass*, signed char, signed char, signed char, unsigned int)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP8SPIClassaaaj+0x0): multiple definition of `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, SPIClass*, signed char, signed char, signed char, unsigned int)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP8SPIClassaaaj+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, SPIClass*, signed char, signed char, signed char, unsigned int)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP8SPIClassaaaj+0x0): multiple definition of `Adafruit_GrayOLED::Adafruit_GrayOLED(unsigned char, unsigned short, unsigned short, SPIClass*, signed char, signed char, signed char, unsigned int)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDC2EhttP8SPIClassaaaj+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::~Adafruit_GrayOLED()':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDD2Ev+0x0): multiple definition of `Adafruit_GrayOLED::~Adafruit_GrayOLED()'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDD2Ev+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::~Adafruit_GrayOLED()':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDD2Ev+0x0): multiple definition of `Adafruit_GrayOLED::~Adafruit_GrayOLED()'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDD2Ev+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::~Adafruit_GrayOLED()':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLEDD0Ev+0x0): multiple definition of `Adafruit_GrayOLED::~Adafruit_GrayOLED()'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLEDD0Ev+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::oled_command(unsigned char)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED12oled_commandEh+0x0): multiple definition of `Adafruit_GrayOLED::oled_command(unsigned char)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED12oled_commandEh+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::invertDisplay(bool)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED13invertDisplayEb+0x0): multiple definition of `Adafruit_GrayOLED::invertDisplay(bool)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED13invertDisplayEb+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::oled_commandList(unsigned char const*, unsigned char)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED16oled_commandListEPKhh+0x0): multiple definition of `Adafruit_GrayOLED::oled_commandList(unsigned char const*, unsigned char)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED16oled_commandListEPKhh+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::clearDisplay()':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED12clearDisplayEv+0x0): multiple definition of `Adafruit_GrayOLED::clearDisplay()'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED12clearDisplayEv+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::_init(unsigned char, bool)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED5_initEhb+0x0): multiple definition of `Adafruit_GrayOLED::_init(unsigned char, bool)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED5_initEhb+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::getPixel(short, short)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED8getPixelEss+0x0): multiple definition of `Adafruit_GrayOLED::getPixel(short, short)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED8getPixelEss+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::getBuffer()':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED9getBufferEv+0x0): multiple definition of `Adafruit_GrayOLED::getBuffer()'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED9getBufferEv+0x0): first defined here
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o: In function `Adafruit_GrayOLED::setContrast(unsigned char)':
Adafruit_GrayOLED.cpp:(.text._ZN17Adafruit_GrayOLED11setContrastEh+0x0): multiple definition of `Adafruit_GrayOLED::setContrast(unsigned char)'
/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-A4714554AD4B009504077A1887858FB4/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED 2.cpp.o:Adafruit_GrayOLED 2.cpp:(.text._ZN17Adafruit_GrayOLED11setContrastEh+0x0): first defined here
collect2: error: ld returned 1 exit status
Using library SPI at version 1.0 in folder: /Users/fabriziobianchi/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/SPI 
Using library Wire at version 1.0.1 in folder: /Users/fabriziobianchi/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/Wire 
Using library Adafruit_GFX_Library at version 1.10.9 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_GFX_Library 
Using library Adafruit_SSD1306 at version 2.4.5 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_SSD1306 
Using library Adafruit_BusIO at version 1.7.3 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_BusIO 
Compilation error: Error: 2 UNKNOWN: exit status 1

One final comment. I didn't touch the above libraries at all