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

Thread: Teensy Compile Problem in function main

  1. #1
    Junior Member
    Join Date
    Jun 2018
    Posts
    3

    Teensy Compile Problem in function main

    I bought a Teensy 3.2 so I could control some LED addressable strips in my pinball cabinet, following this thread:

    http://www.vpforums.org/index.php?showtopic=36156



    This is the TeensyStripController I'm trying to install onto the Teensy

    https://github.com/DirectOutput/TeensyStripController



    On 2 separate computers, I get this error while trying to compile

    C:\Users\Matt\AppData\Local\Temp\arduino_build_655 389/core\core.a(main.cpp.o): In function `main':

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/main.cpp:51: undefined reference to `setup'

    C:\Program Files (x86)\Arduino\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.


    The script author doesn't seem to know the issue. He says the code is ok so must be something else?

    https://github.com/DirectOutput/Teen...oller/issues/1


    I've installed the Arduino 1.8.5 package and then the Teensyduino extensions. Then tried to compile the script via the Arduino software on both a Win10 box and a Win7 box both give the exact same error.

    I'm at a loss. Do I have a bad Teensy?


    Click image for larger version. 

Name:	teensyerror1.jpg 
Views:	29 
Size:	59.1 KB 
ID:	14008

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,831
    This error is in the build system - nothing to do with the Teensy. With a failed build it has not even looked for a Teensy.

    Can you compile a simple Blink.ino or other from examples? If not something corrupted the install, if so then the problem is in the Sketch or associated library files causing conflicts with core files.

  3. #3
    Junior Member
    Join Date
    Jun 2018
    Posts
    3
    Quote Originally Posted by defragster View Post
    This error is in the build system - nothing to do with the Teensy. With a failed build it has not even looked for a Teensy.

    Can you compile a simple Blink.ino or other from examples? If not something corrupted the install, if so then the problem is in the Sketch or associated library files causing conflicts with core files.
    Huh. Well, the software I installed was the Arduino IDE Installer 1.8.5 from https://www.arduino.cc/en/main/software, and then the Teensyduino Installer for Windows from here https://www.pjrc.com/teensy/td_download.html

    Is there another piece of software I I need to install?

    I was able to successfully compile and upload the blink fast/slow examples for Teensy 3.1/3.2. I can't imagine it's the Sketch only because others have used it no problem. What associated library files could be causing a conflict? (Or am I missing some other install?)

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,831
    Well … your Teensy is fine then ...

    Quote Originally Posted by defragster View Post
    ...
    Can you compile a simple Blink.ino or other from examples? ..., if so then the problem is in the Sketch or associated library files causing conflicts with core files.
    No, the fact that BLINK worked means the build system isn't the problem - that was the test.

    The problem is in the other sketch and some error or conflict with what was brought in or how or where it was brought in.

    There should be no issues with MAIN.cpp from the CORE code.

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,785
    FWIW, I downloaded the code, put it in a folder named TeensyStripController on my Linux system in the Arduino directory, and I did a build of it for Teensy 3.2 using Teensy 1.42.

    I suspect you have corrupted the file(s). Perhaps you eliminated a line containing */, and the compiler treated everything else as comment. Perhaps in downloading the file, it changed the spelling of the setup and loop functions. Likely, it is something obvious, but you likely would need somebody near by who is familiar with the build system to see what it is.

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,831
    Good to know MichaelM - I didn't go that far. Cut and paste can go odd - I've gotten alternate filler chars that mess up lines … It may show in a VERBOSE copy of the output on a clean build from the console window.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,318
    Looks like you simply copied the wrong file.

    The code in your screenshot is obviously NOT the same as TeensyStripController.ino from github.

    TeensyStripController you meant to compile begins with this:

    Code:
    /********************************************************************************************************
     ** TeensyStrip Controller
     ** ----------------------
     ** 
     ** This Sketch turns a Teensy 3.1, 3.2 or later into a controller for WS2811/WS2812 based led strips.
     ** This strip controller was originally designed for use with the Direct Output Framework, but since 
     ** the communication protocol is simple and communication uses the virtual com port of the Teensy
     ** it should be easy to controll the strips from other applications as well.
    But here is the code visible in your screenshot:

    Click image for larger version. 

Name:	teensyerror1.jpg 
Views:	17 
Size:	16.7 KB 
ID:	14047

    Looks like you somehow copied the wrong file. You're getting this error because you're compiling completely different code than the program you intended to use.

  8. #8
    Junior Member
    Join Date
    Jun 2018
    Posts
    3
    Quote Originally Posted by PaulStoffregen View Post
    Looks like you simply copied the wrong file.

    The code in your screenshot is obviously NOT the same as TeensyStripController.ino from github.

    TeensyStripController you meant to compile begins with this:

    Code:
    /********************************************************************************************************
     ** TeensyStrip Controller
     ** ----------------------
     ** 
     ** This Sketch turns a Teensy 3.1, 3.2 or later into a controller for WS2811/WS2812 based led strips.
     ** This strip controller was originally designed for use with the Direct Output Framework, but since 
     ** the communication protocol is simple and communication uses the virtual com port of the Teensy
     ** it should be easy to controll the strips from other applications as well.
    But here is the code visible in your screenshot:

    Click image for larger version. 

Name:	teensyerror1.jpg 
Views:	17 
Size:	16.7 KB 
ID:	14047

    Looks like you somehow copied the wrong file. You're getting this error because you're compiling completely different code than the program you intended to use.
    So, I think I found the issue, HOW this happened I don't know...

    Somehow the code from the file I was trying to compile says TEENSYDUINO, not... TEENSYSTRIP.

    I just downloaded a new zip from GitHub, same method (green button, download zip) and the file was ok and compiled ok. But I never opened a TeensyDuino file, so how that code got into the TeenyStrip file I do not know. But it compiled ok this go around so thanks for taking a look.
    Last edited by mriggins; 06-19-2018 at 03:43 PM.

Posting Permissions

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