Go Down

Topic: old sketches won't compile with 012 (Read 475 times) previous topic - next topic

robotman777

Just downloaded 012 and some of my old sketches won't compile because of a ton of errors (they used to be fine).

My sketch has the following includes:
Code: [Select]
#include <Servo.h>
#include <FrequencyTimer2.h>


I get the following errors:

In file included from /Users/maccres/Desktop/arduino-0012/hardware/cores/arduino/WProgram.h:4,

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:80: error: expected unqualified-id before 'int'

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:80: error: expected `)' before 'int'

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:80: error: expected `)' before 'int'

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:111: error: expected unqualified-id before 'int'

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:111: error: expected `)' before 'int'

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:111: error: expected `)' before 'int'

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected identifier before '(' token

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected `)' before '(' token

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected ',' or '...' before '(' token

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:144: error: expected initializer before ')' token

/Users/maccres/Desktop/arduino-0012/hardware/tools/avr/bin/../lib/gcc/avr/4.3.0/../../../../avr/include/stdlib.h:176: error: '__compar_fn_t' has not been declared

In file included from /Users/maccres/Desktop/arduino-0012/hardware/cores/arduino/WProgram.h:6,


mem

#1
Sep 21, 2008, 10:38 pm Last Edit: Sep 21, 2008, 10:46 pm by mem Reason: 1
A number of people have reported similar problems. I think its caused by including wiring.h in the header file.  In FrequencyTimer2.h, try replacing
#include <wiring.h>  
  with
#include <inttypes.h>

You may  need to to add
#include <wiring.h>  
 to the FrequencyTimer2.cpp file just after the  #include <FrequencyTimer2.h>


robotman777

thanks! those suggested changes worked http://www.arduino.cc/yabbfiles/Templates/Forum/yabb21/smiley.gif

Paolo Bosetti

Maybe this is of interest: version 012 also broke compatibility with ServoTimeTimer1, ServoTimer1, and MsTimer2 libraries (amongst other).

In most of the cases, the compiling errors can be solved by adding
Code: [Select]

#include <stdlib.h>
#include <math.h>

BEFORE including the library itself.

Regards,
-P.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy