I'm now trying to port the gaikl ArduinoEthernet libraries to 1.0 RC 2.
I'm using Pauls tip:
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
But I still get a lot of errors. It seems to be they changed more than just renaming WProgram.h to Arduino.h and "Renamed Ethernet Client, Server, and UDP classes to EthernetClient, EthernetServer, and EthernetUDP."
Any leads on this?!
I changed:
#include "wiring.h"
to
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "wiring.h"
#endif
as discussed here:
http://code.google.com/p/arduino/issues/detail?id=682But other header files like
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
seem to be redundant now so I also made those conditional.
E.g. Paul can you elaborate on that?! I can't find the reason for these errors other than that Arduino.h is redeclaring stuff that is already declared using the mentioned header files.
Most of the time errors are of this form:
In file included from /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:191,
from /Applications/Arduino.app/Contents/Resources/Java/libraries/EthernetBonjour/EthernetBonjour.cpp:29:
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:116: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, const char*)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:115: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const String&)' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:117: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, char)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:116: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, const char*)' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:118: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:117: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, char)' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:119: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, int)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:118: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned char)' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:120: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:119: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, int)' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:121: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long int)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:120: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, unsigned int)' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:122: error: declaration of C function 'StringSumHelper& operator+(const StringSumHelper&, long unsigned int)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/WString.h:121: error: previous declaration 'StringSumHelper& operator+(const StringSumHelper&, long int)' here
In file included from /Applications/Arduino.app/Contents/Resources/Java/libraries/EthernetBonjour/EthernetBonjour.cpp:29:
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:195: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:194: error: previous declaration 'uint16_t makeWord(uint16_t)' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:205: error: declaration of C function 'long int random(long int)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:206: error: declaration of C function 'long int random(long int, long int)' conflicts with
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:205: error: previous declaration 'long int random(long int)' here