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

Thread: Teensy 3.0 & Teensyduino: Undefined reference to 'setup' during "Verify"

  1. #1

    Question Teensy 3.0 & Teensyduino: Undefined reference to 'setup' during "Verify"

    I just installed the Teensyduino additions to Arduino. As per the instructions, I clicked the "Verify" button. I get the following error:

    Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.0"
    main.cpp.o: In function `main':
    /Users/david/Desktop/DevelopmentProjects/Arduino/ undefined reference to `setup'
    /Users/david/Desktop/DevelopmentProjects/Arduino/ undefined reference to `loop'
    collect2: error: ld returned 1 exit status
    I have seen this discussed but I have not seen a resolution.

    Any advice appreciated.

    Thanks, David

  2. #2
    Senior Member
    Join Date
    Feb 2013
    You have to have a setup() and a loop() function in your sketch (even if they do nothing). If you DO have those functions in your sketch, something else is going wrong and I have no idea what it would be.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    We can do much more to help if you follow these guidelines when you post your question.

  4. #4
    Short answer: I did not have a sketch loaded. The 'setup' and 'loop' are the entry points in a sketch. The problem did not occur once I loaded a sketch.

    Longer answer:

    The last screen of the teensduino installer ( says for "First Usage" to "Click Verify". I thought that this was a step to verify that the installer had installed its files successfully. Therefore, I thought the problem I was having was related to the installation. This was not the case.

    What I missed was that the window also says "To Run Your Sketch on the Teensy USB Board". In retrospect, I see that this means that a sketch must be loaded in the window first. Once I loaded a sketch the problem did not occur.

    For me the confusion is that it is not clear what "First Usage" means in this context. Is it "First Usage" of Teensy or "First Usage" of any sketch?



    I would like to suggest a button or link on the last screen of the installer that says "If this is your first time using Teensyduino click here". This would bring up a window or web page that walks the user through the next few steps to verify that the Teensy is connected and working.

    Thanks, David

Posting Permissions

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