Pages: [1]   Go Down
Author Topic: old sketches won't compile with 012  (Read 364 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 217
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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,

Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>

« Last Edit: September 21, 2008, 03:46:22 pm by mem » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 217
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Trento, Italy
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino (kinda) rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#include <stdlib.h>
#include <math.h>
BEFORE including the library itself.

Regards,
-P.
Logged

Pages: [1]   Go Up
Jump to: