Running example 'midi_test' failed because of abstract type

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
TomItagaki
 
Posts: 2
Joined: Sat May 29, 2021 5:44 am

Running example 'midi_test' failed because of abstract type

Post by TomItagaki »

When I tried to run midi_test, which is in Adafruit TinyUSB Library, an error occurred as follow:

Code: Select all

midi_test:23:20: error: cannot declare variable 'usb_midi' to be of abstract type 'Adafruit_USBD_MIDI'
 Adafruit_USBD_MIDI usb_midi;
                    ^~~~~~~~
In file included from /Users/itagakitomoya/Documents/Arduino/libraries/Adafruit_TinyUSB_Library/src/Adafruit_TinyUSB.h:40:0,
                 from /var/folders/c6/dc50m8yx7nd721_8tf5zgxhm0000gn/T/arduino_modified_sketch_501094/midi_test.ino:19:
/Users/itagakitomoya/Documents/Arduino/libraries/Adafruit_TinyUSB_Library/src/arduino/midi/Adafruit_USBD_MIDI.h:31:7: note:   because the following virtual functions are pure within 'Adafruit_USBD_MIDI':
 class Adafruit_USBD_MIDI : public Stream, public Adafruit_USBD_Interface {
       ^~~~~~~~~~~~~~~~~~
In file included from /Users/itagakitomoya/Library/Arduino15/packages/Seeeduino/hardware/samd/1.8.1/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/Adafruit_TinyUSB_Core.h:35:0,
                 from /Users/itagakitomoya/Library/Arduino15/packages/Seeeduino/hardware/samd/1.8.1/cores/arduino/Arduino.h:171,
                 from /var/folders/c6/dc50m8yx7nd721_8tf5zgxhm0000gn/T/arduino_modified_sketch_501094/midi_test.ino:18:
/Users/itagakitomoya/Library/Arduino15/packages/Seeeduino/hardware/samd/1.8.1/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/Adafruit_USBD_Device.h:38:22: note: 	virtual uint16_t Adafruit_USBD_Interface::getDescriptor(uint8_t, uint8_t*, uint16_t)
     virtual uint16_t getDescriptor(uint8_t itfnum, uint8_t* buf, uint16_t bufsize) = 0;
                      ^~~~~~~~~~~~~
exit status 1
cannot declare variable 'usb_midi' to be of abstract type 'Adafruit_USBD_MIDI'
Is this say that I should implement additional class using Adafruit_USBD_MIDI?

---
Arduino: Seeeduino XIAO
Arduino IDE: 1.8.15
Adafruit_TinyUSB: 1.0.3
MacbookPro: 11.2.3 (Big Sur)

User avatar
hathach
 
Posts: 1279
Joined: Tue Apr 23, 2013 1:02 am

Re: Running example 'midi_test' failed because of abstract t

Post by hathach »

There is a major changes in TinyUSB lib from v1.0.0 that require core changes by xiao bsp.

https://github.com/adafruit/Adafruit_Ti ... /tag/1.0.0

Until they make change, you could continue to use the 0.10.5

User avatar
TomItagaki
 
Posts: 2
Joined: Sat May 29, 2021 5:44 am

Re: Running example 'midi_test' failed because of abstract t

Post by TomItagaki »

Thank you so much for your reply, hathach.
I will make library downgrade to 0.10.5 as you suggest

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”