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

Thread: Teensy 3.2 compile problem

  1. #1
    Junior Member
    Join Date
    Feb 2018
    Posts
    2

    Teensy 3.2 compile problem

    Hello! I am completely new here and I have one problem.

    I following tutorial on youtube: https://www.youtube.com/watch?v=wqt55OAabVs and now I trying "12:02 Part 2-3 Playing Samples" When I export code http://prntscr.com/idu274 and paste in arduino compiler I have error: http://prntscr.com/idu2mz

    Error code:

    Code:
    C:\Users\Vukasin\AppData\Local\Temp\arduino_build_949578/core\core.a(main.cpp.o): In function `main':
    
    C:\Program Files (x86)\Arduino2018\hardware\teensy\avr\cores\teensy3/main.cpp:51: undefined reference to `setup'
    
    C:\Program Files (x86)\Arduino2018\hardware\teensy\avr\cores\teensy3/main.cpp:53: undefined reference to `loop'
    
    collect2.exe: error: ld returned 1 exit status
    
    Error compiling for board Teensy 3.2 / 3.1.
    Previous sketch "test hardware" with bip bip sound working fine.

    Can anyone helps meee

    Thank you!

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,250
    As the linker error says, you need to define two functions:
    • setup -- This is called once to allow you to initialize things;
    • loop -- This is called to do the stuff you want to do, and it is called continiously.

  3. #3
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,191
    I suspect in pasting in the export from the gui, you deleted the latter part of the example sketch. Start again with a fresh copy of example "12:02 Part 2-3 Playing Samples" -- you'll see it has a setup() and loop(). Be careful as you paste in the export data from the gui.

  4. #4
    Junior Member
    Join Date
    Feb 2018
    Posts
    2
    Yes yes! there is a problem! I successfully compile this time! I thought code from export is enough, but now I saw mail idea what is export from GUI and what a must programming in arduino ide. Thank you very much Michael and Manitou for your time. Cya

Posting Permissions

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