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

Thread: redeclared as different kind of symbol only on Teensy 3.

  1. #1

    redeclared as different kind of symbol only on Teensy 3.

    Hi,


    This code compile without error on Teensy2 but not with Teensy3 ?

    What is wrong ?

    Code:
    byte index = 0;
    char message[10];
    
    
    void setup() 
    {
    strcpy(message,"123456");
    
    }
    
    void loop() 
    {
      Serial.print("\r\nmessage ");
      while (message[index] != '\0')
      {
        Serial.print(message[index]);
        index++;
      }
    }
    Thanks

  2. #2
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    544
    index() is defined as a function in string.h. This function seems to be deprecated but it looks like the ARM compiler used for Teensy 3 still implements it. I assume that the AVR compiler for Teensy2 does not implement it, so that your example compiles for a Teensy2.

    Just rename your variable to something else and it will compile.

  3. #3
    Perfect!!!!

    Thanks luni !!

Posting Permissions

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