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

Thread: Compile issues on Windows Arduino IDE 1.8.1 (Windows 10), TD: 1.35

  1. #1
    Junior Member
    Join Date
    Apr 2016
    Posts
    4

    Compile issues on Windows Arduino IDE 1.8.1 (Windows 10), TD: 1.35

    I'm having difficulty compiling code to my teensy 3.2

    Here's the error I'm recieving from the Arduino IDE

    Code:
    Arduino: 1.8.1 (Windows 10), TD: 1.35, Board: "Teensy 3.2 / 3.1, Serial + Keyboard + Mouse + Joystick, 96 MHz (overclock), Fast, US English"
    exec: "D:\\Arduino181\\hardware\\teensy/../tools//teensy_post_compile": file does not exist
    Error compiling for board Teensy 3.2 / 3.1.
    Here's the code it's compiling:
    Code:
    
    int redPin =  14;
    
    void setup()   {                
      Serial.begin(38400);
      pinMode(7, INPUT);
      pinMode(8, INPUT_PULLUP);
      pinMode(redPin, OUTPUT);
    }
    
    void loop()                     
    {
      Keyboard.begin();
      if (digitalRead(7) == HIGH) {
        Serial.println("AAA Button is not pressed...");
      } else {
        Serial.println("AAA Button pressed!!!");
    
        //turn on the light a bit
        digitalWrite(redPin, HIGH);
        
        // adding an artificial delay to begin with
        delay(3000);
        Keyboard.print("Hello There!");
        delay(500);
        //turn off the light
        digitalWrite(redPin, LOW);
      }
      if (digitalRead(8) == HIGH) {
        Serial.println("BBB Button is not pressed...");
      } else {
        Serial.println("BBB Button pressed!!!");
    
        //turn on the light a bit
        digitalWrite(redPin, HIGH);
    
        // make it wait just a little bit
        delay(1500);
        
        Keyboard.print("How's it going?");
        delay(1000);
    
        //turn off the light
        digitalWrite(redPin, LOW);
      }
      delay(500);
    }

    Any help would be greatly appreciated!


    Thanks,
    -Doug Jr.
    Last edited by douglas; 02-09-2017 at 10:44 PM. Reason: I needed to add my code

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,481
    Try running the Teensyduino installer again. In the step where you select Arduino, make sure to navigate to D:\ and select your Arduino181 folder.

    Temporarily turn off anti-virus and Windows Defender. These often interfere with successful installation.

  3. #3
    Junior Member
    Join Date
    Apr 2015
    Posts
    8
    I can't get the examples compiled.
    For the example "Buttons" from menu File\Examples\Teensy\USB_Keyboard i get the error

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Print.h:86: undefined reference to `Keyboard'
    collect2.exe: error: ld returned 1 exit status
    Error compiling for board Teensy 3.2 / 3.1.

    I get the same errors if i include
    #include <usb_keyboard.h>
    or
    #include <keyboard.h>

    Menu Tools\USB Type\Keyboard is chosen.

    I did quite a few projects with teensy already and had no issues up to now.
    All other Teensy examples i tried work properly.
    Tensyduino is executed as administrator and everything seems where it needs to be.
    Currently Arduino 1.8.5 & Teensyduino 1.40 is used

    Very confusing.

    Any ideas are welcome?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,481
    Quote Originally Posted by ralphberner View Post
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Print.h:86: undefined reference to `Keyboard'
    collect2.exe: error: ld returned 1 exit status
    You need to set Tools > USB Type to any of the options with "Keyboard".

    This is supposed to be mentioned in the comments at the top of that file, and Arduino is supposed to print "To make a USB Keyboard, use the Tools > USB Type menu" right next to the error. But these can be easy to miss.

    Just know, the answer you need is the Tools > USB Type menu.

  5. #5
    Junior Member
    Join Date
    Apr 2015
    Posts
    8
    Thanks

    Im not shure about the answer, but i wrote that i chose "Keyboard" from the USB-Type menu.
    Are we talking about the same?

    Regards.

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,503
    I tried your example code. I choose a T3.2 I and USB type: Keyboard and it built fine.
    I also tried: keyboard+mouse+Joystick... It also built fine.

    I am running 1.85 with 1.40 on Windows 10.

    So to reiterate what Paul said:
    Double check that you have the right settings. Actually if it is working strangely I would choose a different board type... Then come back choose:
    Teensy 3.2/1 then change the USB type to Keyboard.

    If this fails maybe take a screen shot of your IDE window with the error, that also shows the data at the bottom of the Arduino window.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,481
    I tried it just now, Arduino 1.8.5 and Teensyduino 1.40. Compiles without any error. Here's a screenshot.

    Click image for larger version. 

Name:	capture.jpg 
Views:	38 
Size:	110.7 KB 
ID:	12230
    (click for full size)

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,481
    Just a guess, maybe your installation is corrupt? Please try downloading a fresh copy of Arduino and Teensyduino and reinstall both. This really does work when you have a good install.

    Recently it seems there have been cases where an anti-virus program like Windows Defender (built into all new Windows) has interfered with installation. Maybe that's what's happened here? Really, I'm just guessing, but I'd *really* like to know what went wrong!

  9. #9
    Junior Member
    Join Date
    Apr 2015
    Posts
    8
    I found the nasty trap. The CPU speed was set to "8MHz (non USB)" from a previous project.
    It needs to be set to 24MHz or higher, to include USB functionality of course.
    No reinstallation was needed.
    I found it while comparing to a second new setup in a VMware-Image. It compiled immediately there.
    A hint in the demo to that would help maybe, because one can stomble over that easily.
    Thanks for your help. It caused a quick solution. Otherwise i had got lost.

Posting Permissions

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