strtok problem

i am trying to switch my project over to arduino v18 linux from v18 mac
when i try to compile i get an error with strtok

error: 'strtok' was not declared in this scope

any help is greatly appreciated

Thanks
Jeff

Add this to the top of your Sketch...

#include <string.h>

i tried that first, but no go.

seems like something else is messed up...

Being unfamiliar with Linux, I can't think of any more suggestions. Hopefully, someone else can offer something.

can we see your sketch/code?

here is the one function that uses strtok
just a reminder that this code has been working for months under Mac OS X arduino v18

void parseCommand(char * inStr)
{
  byte i = 0;
  char * pch;

  argv[0][0] = '\0';
  argv[1][0] = '\0';
  argv[2][0] = '\0';
  argv[3][0] = '\0';
  argv[4][0] = '\0';
  argv[5][0] = '\0';
  if (inStr[0] == '\0') return;

  pch = strtok (inStr," ");
  while (pch != NULL)
  {
    strcpy(argv[i], pch);
    i++;

    if (i < 6)
      pch = strtok (NULL, " ");
    else
      pch = NULL; 
  }
  argc = i;
}

Maybe this thread might help...

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231961642

thanks for the link.
i realize after doing some reading that strtok is probably not a good idea. i guess i'm just curious now why my code compiles on mac but not on linux.
i'm guessing that arduino is using two different versions of gcc. i was just hoping that somebody might be able to confirm and or explain the difference between arduino for linux and arduino for mac.

Thanks
Jeff

i'm guessing that arduino is using two different versions of gcc.

The Arduino IDE invokes whichever version of avr-gcc is installed on the computer.

There are versions of avr-gcc for the Mac, for all the flavors of Windows (XP, Vista, Seven, 32 bit and 64 bit) and for all the flavors of Linux (32 bit and 64 bit).

There are current versions and older versions of avr-gcc for each of the platforms.

As you've discovered, they are not all compatible.