Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: Error compiling for board Teensy 4.0

  1. #1
    Junior Member
    Join Date
    Jan 2023
    Location
    New York
    Posts
    8

    Error compiling for board Teensy 4.0

    Hey Everyone,

    I am building a Audio Guest Book with a Teensy 4.0 with an Audio Shield. I keep getting this error???


    Click image for larger version. 

Name:	unnamed.jpg 
Views:	14 
Size:	129.0 KB 
ID:	30112Click image for larger version. 

Name:	un1named.jpg 
Views:	20 
Size:	214.3 KB 
ID:	30113

    Arduino: 1.8.16 (Windows 10), TD: 1.57, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English, Normal"


    Multiple libraries were found for "SD.h"

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:30:24: fatal error: MTP_Teensy.h: No such file or directory

    Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

    compilation terminated.

    Not used: C:\Program Files (x86)\Arduino\libraries\SD

    Error compiling for board Teensy 4.0.



    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  2. #2
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    564
    Quote Originally Posted by Ronnie Rock View Post
    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:30:24: fatal error: MTP_Teensy.h: No such file or directory
    See <this> forum post . . . maybe you are seeing the same problem ?!?

    Mark J Culross
    KD5RXT

  3. #3
    Junior Member
    Join Date
    Jan 2023
    Location
    New York
    Posts
    8
    Quote Originally Posted by kd5rxt-mark View Post
    See <this> forum post . . . maybe you are seeing the same problem ?!?

    Mark J Culross
    KD5RXT

    Hi Mark,

    I followed that link, Downloaded the MTP_Teensy-main. I dropped the whole folder in the SD folder, following the path leading to the error. I am getting the same error..

  4. #4
    You may want to try TeensyDuino 1.58b3. The last post in the linked thread says

    compiled just fine using TeensyDuino 1.58b3.

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,874
    Quote Originally Posted by Ronnie Rock View Post
    Hi Mark,

    I followed that link, Downloaded the MTP_Teensy-main. I dropped the whole folder in the SD folder, following the path leading to the error. I am getting the same error..
    MTP_Teensy is its own library - not to be placed within the SD library folder.

    That download folder should go into <sketchbook>\libraries.

  6. #6
    Junior Member
    Join Date
    Jan 2023
    Location
    New York
    Posts
    8

    New Error... Please help

    Quote Originally Posted by joepasquariello View Post
    You may want to try TeensyDuino 1.58b3. The last post in the linked thread says
    Arduino: 1.8.16 (Windows 10), TD: 1.58-beta2, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English, Normal"


    Here are my New Errors:




    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:49:15: warning: missing terminating ' character

    49 | AudioPlaySdWav' playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file

    | ^

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:49:15: error: missing terminating ' character

    49 | AudioPlaySdWav' playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file

    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:50:29: error: expected initializer before 'queue1'

    50 | AudioRecordQueue queue1; // Creating an audio buffer in memory before saving to SD

    | ^~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\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:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:57:37: error: 'queue1' was not declared in this scope

    57 | AudioConnection patchCord5(i2s2, 0, queue1, 0); // mic input to queue (L)

    | ^~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void loop()':

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:185:7: error: 'playWav1' was not declared in this scope

    185 | playWav1.play("greeting.wav");

    | ^~~~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void startRecording()':

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:282:5: error: 'queue1' was not declared in this scope

    282 | queue1.begin();

    | ^~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void continueRecording()':

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:297:7: error: 'queue1' was not declared in this scope

    297 | if (queue1.available() >= NBLOX) {

    | ^~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void stopRecording()':

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:329:3: error: 'queue1' was not declared in this scope

    329 | queue1.end();

    | ^~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void playAllRecordings()':

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:374:7: error: 'playWav1' was not declared in this scope

    374 | playWav1.play(entry.name());

    | ^~~~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:380:13: error: 'playWav1' was not declared in this scope

    380 | while (!playWav1.isStopped()) { // this works for playWav

    | ^~~~~~~~

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino: In function 'void playLastRecording()':

    C:\Program Files (x86)\Arduino\tools\audio-guestbook-main\audio-guestbook\audio-guestbook.ino:411:3: error: 'playWav1' was not declared in this scope

    411 | playWav1.play(filename);

    | ^~~~~~~~

    Multiple libraries were found for "SD.h"

    Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

    Not used: C:\Program Files (x86)\Arduino\libraries\SD

    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 2.0.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

    Using library SdFat at version 2.1.2 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat

    Using library SerialFlash at version 0.5 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Serial Flash

    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

    Error compiling for board Teensy 4.0.

  7. #7
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,911
    Code:
    AudioPlaySdWav' playWav1; // Play 44.1kHz 16-bit PCM greeting WAV file
    There should not be a single quote in that statement.

    If there are any other errors, post all your code (in code tags please).

    Pete

  8. #8
    Junior Member
    Join Date
    Jan 2023
    Location
    New York
    Posts
    8
    YES!!!! Thank You Pete! It worked... Thank you everyone who helped me with this project..

  9. #9
    Junior Member
    Join Date
    Jan 2023
    Location
    New York
    Posts
    8

    MORE ERRORS - Why Am I getting this?

    Arduino: 1.8.16 (Windows 10), TD: 1.57, Board: "Teensy 4.0, MTP Disk (Experimental), 600 MHz, Faster, US English"


    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Program Files (x86)\Arduino\audio-guestbook\libraries -fqbn=teensy:avr:teensy40:usb=mtp,speed=600,opt=o2s td,keys=en-us -ide-version=10816 -build-path C:\Users\ronni\AppData\Local\Temp\arduino_build_26 6043 -warnings=none -build-cache C:\Users\ronni\AppData\Local\Temp\arduino_cache_55 964 -verbose C:\Users\ronni\Desktop\audio-guestbook\audio-guestbook.ino

    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Program Files (x86)\Arduino\audio-guestbook\libraries -fqbn=teensy:avr:teensy40:usb=mtp,speed=600,opt=o2s td,keys=en-us -ide-version=10816 -build-path C:\Users\ronni\AppData\Local\Temp\arduino_build_26 6043 -warnings=none -build-cache C:\Users\ronni\AppData\Local\Temp\arduino_cache_55 964 -verbose C:\Users\ronni\Desktop\audio-guestbook\audio-guestbook.ino

    Using board 'teensy40' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr

    Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr

    Detecting libraries used...

    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10816 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_MTPDISK -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "C:\\Users\\ronni\\AppData\\Local\\Temp\\arduino_b uild_266043\\sketch\\audio-guestbook.ino.cpp" -o nul

    Alternatives for Bounce.h: [Bounce]

    ResolveLibrary(Bounce.h)

    -> candidates: [Bounce]

    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10816 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_MTPDISK -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Bounce" "C:\\Users\\ronni\\AppData\\Local\\Temp\\arduino_b uild_266043\\sketch\\audio-guestbook.ino.cpp" -o nul

    Alternatives for Audio.h: [Audio@1.3]

    ResolveLibrary(Audio.h)

    -> candidates: [Audio@1.3]

    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10816 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_MTPDISK -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Bounce" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Audio" "C:\\Users\\ronni\\AppData\\Local\\Temp\\arduino_b uild_266043\\sketch\\audio-guestbook.ino.cpp" -o nul

    Alternatives for SPI.h: [SPI@1.0]

    ResolveLibrary(SPI.h)

    -> candidates: [SPI@1.0]

    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10816 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_MTPDISK -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Bounce" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Audio" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\ronni\\AppData\\Local\\Temp\\arduino_b uild_266043\\sketch\\audio-guestbook.ino.cpp" -o nul

    Alternatives for SD.h: [SD@1.2.4 SD@2.0.0]

    ResolveLibrary(SD.h)

    -> candidates: [SD@1.2.4 SD@2.0.0]

    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10816 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_MTPDISK -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Bounce" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Audio" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SD\\src" "C:\\Users\\ronni\\AppData\\Local\\Temp\\arduino_b uild_266043\\sketch\\audio-guestbook.ino.cpp" -o nul

    Alternatives for SdFat.h: [SdFat@2.1.2]

    ResolveLibrary(SdFat.h)

    -> candidates: [SdFat@2.1.2]

    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10816 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_MTPDISK -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Bounce" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ Audio" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SD\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SdFat\\src" "C:\\Users\\ronni\\AppData\\Local\\Temp\\arduino_b uild_266043\\sketch\\audio-guestbook.ino.cpp" -o nul

    Alternatives for SerialFlash.h: []

    ResolveLibrary(SerialFlash.h)ram Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/Audio.h:129:0,



    -> candidates: [] from C:\Users\ronni\Desktop\audio-guestbook\audio-guestbook.ino:25:



    Multiple libraries were found for "SD.h"

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/play_serialflash_raw.h:33:25: fatal error: SerialFlash.h: No such file or directory

    Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

    compilation terminated.

    Not used: C:\Program Files (x86)\Arduino\libraries\SD

    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 2.0.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD

    Using library SdFat at version 2.1.2 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat

    Error compiling for board Teensy 4.0.

    Invalid library found in C:\Users\ronni\Documents\Arduino\libraries\librari es: no headers files (.h) found in C:\Users\ronni\Documents\Arduino\libraries\librari es

  10. #10
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,911
    Can you try a fresh install of Arduino 1.8.19 and the latest TD?

    Pete

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,668
    All too often Arduino will print a critical error message together with a lot of unimportant warnings or just info messages.

    This this case, the critical error message is this:

    Quote Originally Posted by Ronnie Rock View Post
    Invalid library found in C:\Users\ronni\Documents\Arduino\libraries\librari es: no headers files (.h) found in C:\Users\ronni\Documents\Arduino\libraries\librari es
    This means you copied things to the wrong place when you tried to manually install a library, and Arduino is now confused because it's seeing a nonsensical set of folders and files. Since the problem is in your Documents folder, reinstalling Arduino and Teensyduino will not help.

    I can't see your hard drive or your screen, so helping you involves some guesswork based only on info show here. My best guess is you meant to copy some library into {Documents}/Arduino/libraries. Maybe it was in a folder called "libraries" somewhere else on your PC where you downloaded it? Perhaps instead of opening that "libraries" folder and dragging its contents to the "libraries" folder at {Documents}/Arduino, maybe you copied the entire "libraries" folder from the source location to {Documents}/Arduino/libraries, which had the result to creating *ANOTHER* "libraries" folder inside {Documents}/Arduino/libraries?

    If you can't figure out how to fix this, and if you don't have any really important work inside that {Documents}/Arduino/libraries (eg, all the libraries are things you've obtained from the internet, not anything you've personally written or modified) then the simplest solution might be the go to {Documents}/Arduino and just completely delete "libraries" and everything inside it, then create a new empty "libraries" folder, and repeat (hopefully correctly) the process of copying all the libraries you need.

    Just to explain a bit more, so you can understand better (if you even want that...) and have the ability to check your work, Arduino expects every folder it finds in {Documents}/Arduino/libraries to be a valid library. If you create empty folders or anything else in that location which isn't a valid library, Arduino will get confused. While the set of files and folders that constitute a "valid library" can vary, usually there is a "library.properties" file. Many libraries have a "src" folder with all the library's code, but others have it in the main folder. Either way, Arduino expects to find at least one .h file, inside the "src" folder if it exists, or otherwise in the main folder.

    When you copy stuff into {Documents}/Arduino/libraries, everything you put there must actually be a library. If you create more sub-folders (like another folder called "libraries" inside "libraries") you'll get this error from Arduino.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •