mseconds

3 replies [Last post]
Adam
Title: MiniBot+
Joined: 07/28/2009
Posts:
BotPoints: 74
User offline. Last seen 10 years 17 weeks ago.

It has been common place in my group to create a function called mseconds for our robots. However, this year the compiler says that it already has mseconds defined. So we use it in out code as is without defining it and it works out fine in the kiss-c compiler. But when the CBC tries to compile the code, it brings up an error saying it doesn't recognize mseconds. We are able to work around this by just using a different name, but i was wondering if there was a way to fix this problem otherwise and if any of the kipr staff knew about this.

catron
catron's picture
Title: ZoomBot
Joined: 06/02/2009
Posts:
BotPoints: 98
User offline. Last seen 10 years 25 weeks ago.

The GCC compiler used on the computer and CBC, while similar, is not identical. There is no way for KIPR to fix this. Using a different name is your best option.

Best of wishes,
Braden McDorman

"When you do things right, people won't know you've done anything at all."

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 13 weeks ago.

You might try conditional compilation. GCC on PC should have different #defines set than GCC on the Chumby. In particular, I would look for an ARM Linux define. A quick google reveals that this may work, although I haven't tried it.

#ifdef __arm__

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

Adam
Title: MiniBot+
Joined: 07/28/2009
Posts:
BotPoints: 74
User offline. Last seen 10 years 17 weeks ago.

thanks guys.