Problem compiling MD_MIDIFile example program

I'm trying to compile the MD_MIDIFile_Play example for my new Adafruit Feather HUZZAH ESP8266 board. I've installed version 2.6.0 of MD_MIDIFile and version 2.1.2 of SdFat using the Library Manager (version 1.8.19 of the IDE). I'm getting the following error messages on compile. Any help much appreciated!

In file included from C:\Users\Elby\Documents\Arduino\libraries\MD_MIDIFile\examples\MD_MIDIFile_Play\MD_MIDIFile_Play.ino:10:
C:\Users\Elby\Documents\Arduino\libraries\SdFat\src/SdFat.h:452:2: warning: #warning File not defined because __has_include(FS.h) [-Wcpp]
  452 | #warning File not defined because __has_include(FS.h)
      |  ^~~~~~~
In file included from C:\Users\Elby\Documents\Arduino\libraries\MD_MIDIFile\examples\MD_MIDIFile_Play\MD_MIDIFile_Play.ino:11:
C:\Users\Elby\Documents\Arduino\libraries\MD_MIDIFile\src/MD_MIDIFile.h:469:9: error: 'File' does not name a type; did you mean 'SdFile'?
  469 | typedef File SDDIR;       ///< File type for folders
      |         ^~~~
      |         SdFile
C:\Users\Elby\Documents\Arduino\libraries\MD_MIDIFile\src/MD_MIDIFile.h:470:9: error: 'File' does not name a type; did you mean 'SdFile'?
  470 | typedef File SDFILE;      ///< File type for files
      |         ^~~~
      |         SdFile
C:\Users\Elby\Documents\Arduino\libraries\MD_MIDIFile\src/MD_MIDIFile.h:1243:3: error: 'SDFILE' does not name a type; did you mean 'FILE'?
 1243 |   SDFILE    _fd;                ///< SDFat file descriptor
      |   ^~~~~~
      |   FILE
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.

Looks like a mismatch between the SdFat library you have installed and the SdFat library expected by the sketch. The documentation points to this version:

I installed the latest SdFat library by 'greiman' and was able to compile the MD_MIDIFile_Play example without error for Arduino UNO. I switched to Board: Adfruit Feather HUZZAH ESP8266 and got the same errors as you. I suspect the sketch is not compatible with the ESP8266.

Hi John, Thanks for the feedback. I tried downloading directly from GitHub, with the same results. It looks like you're right, ESP8266 isn't supported :frowning_face: Any suggestions for alternatives, or things to try most welcome!

The problem seems to be with the SD file support (SdFat.h). One possible solution is to switch from the third-party SdFat.h to the built-in SD.h. It may or may not be easy. :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.