Closed KaakaduRay closed 1 year ago
The first relevant error message is "error: reference to 'File' is ambiguous"
That's because "File" is defined in the following two libraries: C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File' C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:47:7: note: 'class File'
Did you follow the steps about setting the default Teensyduino library location?
Hi Alastaira Thankyou for responding much appreciated, I believe I have the followed the install instructions correctly ? attached screen shots of file locations.
Regards Ray
Sent from Mail for Windows
From: alastaira Sent: Thursday, 7 September 2023 11:58 PM To: playfultechnology/audio-guestbook Cc: KaakaduRay; Author Subject: Re: [playfultechnology/audio-guestbook] Compiling Error (Issue #119)
The first relevant error message is "error: reference to 'File' is ambiguous" That's because "File" is defined in the following two libraries: C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File' C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:47:7: note: 'class File' Did you follow the steps about setting the default Teensyduino library location? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Cleared all old files and reloaded sketch now compiles, however now some new issues to work through of message recording and play back
Hi, Newbie to all Trying to put the audio Guest book together but cannot get past compiling errors, help appreciated. Arduino: 1.8.19 (Windows 10), TD: 1.58, Board: "Teensy 4.0, Serial + MTP Disk (Experimental), 150 MHz, Faster, US English, Bigger blocks (256 samples
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:75:17: error: reference to 'File' is ambiguous
75 | virtual File openNextFile(uint8_t mode=0) = 0;
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:47:7: note: 'class File'
47 | class File;
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h: In member function 'File File::openNextFile(uint8_t)':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:216:33: error: 'class FileImpl' has no member named 'openNextFile'
216 | return (f) ? f->openNextFile(mode) : *this;
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h: At global scope:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:276:17: error: reference to 'File' is ambiguous
276 | virtual File open(const char *filename, uint8_t mode = FILE_READ) = 0;
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:290:9: error: reference to 'File' is ambiguous
290 | File open(const String &filepath, uint8_t mode = FILE_READ) {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:45,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:178:9: error: reference to 'File' is ambiguous
178 | File open(uint32_t store, const char *filename, uint32_t mode) {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:45,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:287:9: error: reference to 'File' is ambiguous
287 | File index_;
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:45,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:288:9: error: reference to 'File' is ambiguous
288 | File file_;
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:45,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:289:9: error: reference to 'File' is ambiguous
289 | File child_;
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
In file included from C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:30:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h: In member function 'uint32_t MTP_class::addFilesystem(SDLib::SDClass&, const char*)':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:78:25: error: no matching function for call to 'MTP_class::addFilesystem(SDLib::SDClass&, const char*&, mtp_fstype_t)'
78 | return addFilesystem(disk, diskname, MTP_FSTYPE_SD);
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:76:12: note: candidate: 'uint32_t MTP_class::addFilesystem(SDLib::SDClass&, const char*)'
76 | uint32_t addFilesystem(SDClass &disk, const char *diskname) {
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:76:12: note: candidate expects 2 arguments, 3 provided
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:82:12: note: candidate: 'uint32_t MTP_class::addFilesystem(FS&, const char*, mtp_fstype_t)'
82 | uint32_t addFilesystem(FS &disk, const char *diskname, mtp_fstype_t fstype = MTP_FSTYPE_UNKNOWN);
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Teensy.h:82:30: note: no known conversion for argument 1 from 'SDLib::SDClass' to 'FS&'
82 | uint32_t addFilesystem(FS &disk, const char *diskname, mtp_fstype_t fstype = MTP_FSTYPE_UNKNOWN);
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: At global scope:
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:49:1: error: 'AudioPlaySdWavX' does not name a type; did you mean 'AudioPlaySdWav'?
49 | AudioPlaySdWavX playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:54:28: error: 'playWav1' was not declared in this scope
54 | AudioConnection patchCord3(playWav1, 0, mixer, 1); // wav file playback mixer
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:63:1: error: reference to 'File' is ambiguous
63 | File frec;
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void setup()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:158:3: error: 'FsDateTime' has not been declared
158 | FsDateTime::setCallback(dateTime);
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void loop()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:185:7: error: 'playWav1' was not declared in this scope
185 | playWav1.play("greeting.wav");
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void startRecording()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:277:3: error: 'frec' was not declared in this scope; did you mean 'free'?
277 | frec = SD.open(filename, FILE_WRITE);
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void continueRecording()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:309:5: error: 'frec' was not declared in this scope; did you mean 'free'?
309 | frec.write(buffer, sizeof buffer);
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void stopRecording()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:333:5: error: 'frec' was not declared in this scope; did you mean 'free'?
333 | frec.write((byte)queue1.readBuffer(), AUDIO_BLOCK_SAMPLESsizeof(int16_t));
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:339:3: error: 'frec' was not declared in this scope; did you mean 'free'?
339 | frec.close();
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void playAllRecordings()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:348:3: error: reference to 'File' is ambiguous
348 | File dir = SD.open("/");
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:351:5: error: reference to 'File' is ambiguous
351 | File entry = dir.openNextFile();
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_sd_raw.h:32,
C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:28:9: note: candidates are: 'class SDLib::File'
28 | class File : public Stream {
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy\src/MTP_Storage.h:35,
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/FS.h:101:7: note: 'class File'
101 | class File final : public Stream {
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:352:16: error: 'entry' was not declared in this scope
352 | if (strstr(entry.name(), "greeting"))
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:354:17: error: 'dir' was not declared in this scope; did you mean 'div'?
354 | entry = dir.openNextFile();
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:356:10: error: 'entry' was not declared in this scope
356 | if (!entry) {
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:366:16: error: 'entry' was not declared in this scope
366 | if (strstr(entry.name(), ".wav") || strstr(entry.name(), ".WAV")) {
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:374:7: error: 'playWav1' was not declared in this scope
374 | playWav1.play(entry.name());
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:377:5: error: 'entry' was not declared in this scope
377 | entry.close();
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:380:13: error: 'playWav1' was not declared in this scope
380 | while (!playWav1.isStopped()) { // this works for playWav
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void playLastRecording()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:411:7: error: 'playWav1' was not declared in this scope
411 | playWav1.play(filename);
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void dateTime(uint16_t, uint16_t, uint8_t*)':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:439:11: error: 'FS_DATE' was not declared in this scope; did you mean 'LS_DATE'?
439 | *date = FS_DATE(year(), month(), day());
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:442:11: error: 'FS_TIME' was not declared in this scope; did you mean 'FAT_TIME'?
442 | *time = FS_TIME(hour(), minute(), second());
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino: In function 'void writeOutHeader()':
C:\Users\raylj\Documents\Arduino\audio-guestbook\audio-guestbook.ino:470:3: error: 'frec' was not declared in this scope; did you mean 'free'?
470 | frec.seek(0);
Using library Bounce in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce (legacy)
Using library Audio at version 1.3 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI
Using library SD at version 1.2.4 in folder: C:\Program Files (x86)\Arduino\libraries\SD
Using library SerialFlash at version 0.5 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire
Using library Time at version 1.6.1 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Time
Using library MTP_Teensy at version 1.0.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MTP_Teensy
Error compiling for board Teensy 4.0.