0

Running example 'midi_test' failed because of abstract type
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Running example 'midi_test' failed because of abstract type

by TomItagaki on Sat May 29, 2021 5:57 am

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

Code: Select all | TOGGLE FULL SIZE
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)

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

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

by hathach on Sat May 29, 2021 10:17 am

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

hathach
 
Posts: 1151
Joined: Tue Apr 23, 2013 1:02 am

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

by TomItagaki on Sun May 30, 2021 12:10 am

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

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

Please be positive and constructive with your questions and comments.