error with arduino.h uint8_t since IDE update

Hi, I've made an automatic window's blind servo controler with the IDE 1.0.6 some months ago.

I've use the VirtualWire and ServoTimer2 librairy (can't use the Servo librairy because conflict with the virtualwire)

Evrything was working very well. It is install on my window since months. But I updated my IDE to 1.6.3 and I wish to modify a value in my project but I can't because now there is this error:

In file included from blindAutomation_receiver.ino:28:0:
C:\Users\Yannick\Documents\Arduino\libraries\ServoTimer2/ServoTimer2.h:41:17: error: conflicting declaration 'typedef uint8_t boolean'
typedef uint8_t boolean;

  • ^*
    In file included from C:\Users\Yannick\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:146:0,
  • from blindAutomation_receiver.ino:27:*
    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:117:14: error: 'boolean' has a previous declaration as 'typedef bool boolean'
    typedef bool boolean;

My code Haven't change except a value for the position of the servo, so this is not the problem.

It says the conflict is between the servo2 and virtualwire librairy. the virtualwire librairy actually call the "arduino.h" librairie wich have the conflicting declaration with this code:

#if defined(ARDUINO)
 #if ARDUINO >= 100
  #include <Arduino.h>
 #else
  #include <wiring.h>
 #endif

Can the IDE update can be the reason or not because either IDE version i had used is "ARDUINO >= 100 ?"

Thank you

Hi wico2002

Open this file in a text editor:

C:\Users\Yannick\Documents\Arduino\libraries\ServoTimer2/ServoTimer2.h

Comment out the line that defines "boolean", so it looks like this:

// typedef uint8_t boolean;

Does that fix the problem?

Regards

Ray

Yes, I'm a programmer (but not used to do c/c++), so I tried to change the name "boolean" to something else and Yes it compile.

I just red on the internet that arduino.h already define the "boolean" nametype (usually should be "bool" in c/c++). So I guess just commenting out this line wiil be OK.

But is arduino.h always used by default even we don't use any particular librairy ? Because if it is, this line of code isn't usefull...

I just red on the internet that arduino.h already define the "boolean" nametype (usually should be "bool" in c/c++).

"Boolean" was introduced in Arduino because the authors thought it would be clearer in meaning than "bool".

Originally boolean was defined as uint8_t. This potentially caused problems ...

http://forum.arduino.cc/index.php?topic=252120.0

So boolean was redefined last year to be the same as bool.

But is arduino.h always used by default even we don't use any particular librairy ?

I believe it is. So it still defines "boolean" for backward compatibility with all the programs that use it.

Thank you

still weird it compile with 1.0.6 and not with 1.6.3.