Hello!
I don't understand this error. I think I'm having a compilation issue with the MIDIUSB (1.0.5) when attempting to upload to a newly bought, brand name Arduino Leonardo.
The error message reads:
FQBN: arduino:avr:leonardo
Using board 'leonardo' from platform in folder: /Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Using core 'arduino' from platform in folder: /Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Detecting libraries used...
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/leonardo /Users/avi/Library/Caches/arduino/sketches/9107DFED6FA9D589AF64703BEE6F7AC4/sketch/MIDIUSB_read.ino.cpp -o /dev/null
Alternatives for MIDIUSB.h: [MIDIUSB@1.0.5]
ResolveLibrary(MIDIUSB.h)
-> candidates: [MIDIUSB@1.0.5]
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/leonardo -I/Users/avi/Documents/Arduino/libraries/MIDIUSB/src /Users/avi/Library/Caches/arduino/sketches/9107DFED6FA9D589AF64703BEE6F7AC4/sketch/MIDIUSB_read.ino.cpp -o /dev/null
Error while detecting libraries included by /Users/avi/Library/Caches/arduino/sketches/9107DFED6FA9D589AF64703BEE6F7AC4/sketch/MIDIUSB_read.ino.cpp
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/leonardo -I/Users/avi/Documents/Arduino/libraries/MIDIUSB/src /Users/avi/Documents/Arduino/libraries/MIDIUSB/src/MIDIUSB.cpp -o /dev/null
Error while detecting libraries included by /Users/avi/Documents/Arduino/libraries/MIDIUSB/src/MIDIUSB.cpp
Generating function prototypes...
/Users/avi/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/avi/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/leonardo -I/Users/avi/Documents/Arduino/libraries/MIDIUSB/src /Users/avi/Library/Caches/arduino/sketches/9107DFED6FA9D589AF64703BEE6F7AC4/sketch/MIDIUSB_read.ino.cpp -o /private/var/folders/0j/7b000wx91g1bcxv2pyr1j1l00000gn/T/1398982950/sketch_merged.cpp
In file included from /private/var/folders/0j/7b000wx91g1bcxv2pyr1j1l00000gn/T/.arduinoIDE-unsaved20241110-19249-ix52b1.e2c2j/MIDIUSB_read/MIDIUSB_read.ino:9:0:
/Users/avi/Documents/Arduino/libraries/MIDIUSB/src/MIDIUSB.h:18:2: error: #error MIDIUSB can only be used with an USB MCU.
#error MIDIUSB can only be used with an USB MCU.
^~~~~
exit status 1
Compilation error: exit status 1
Why is this happening? The Leonardo is an ATmega32u4, so what's the problem here?
I am running Arduino IDE v. 2.3.4 and MIDIUSB 1.0.5. I am posting to this forum because I suspect that there is a compilation error, though I do not understand why.
Help much appreciated.