Upgraded IDE 0022 to 1.0.3,now old projects not compiling/uploading - SOLVED

Hi,

I've been using Arduino IDE 0022 for a loong time with Mega 2560 and Ethernet shield. I'm working on a big sketch, improving and developing my project all the time... everything works great with IDE v. 0022, compiling and uploading to the Mega goes normal and sketch runs ok.

Then I decided to try new IDE 1.0.3... when trying to upload my old sketch, compiler gives errors... Should new IDE version(s) be fully compatible with the old one I'm using?

Now I'm back on IDE 0022 and everything works.

Thanks.

You should paste here the exact error messages the compiler is givin you.

Most likely you have #include <WProgram.h> somewhere, perhaps in old libraries (i.e. libs that haven’t been upgraded for 1.x) or ones that you wrote on your own.

That line has to be replaces with:

#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif

to make the code compile under both 002x and 1.x

There are some minor differences. The main ones being:

WProgram.h has been replaced by Arduino.h so in some of your older installed third-party libraries you will need to make that change. You will get an error like "WProgram.h: no such file".

"Serial.print(integer, BYTE);" has been replaced with "Serial.write(integer);". You'll get an error message for the word "BYTE".

In some cases the older third-party libraries will have incompatibilities with the newer libraries (like Print and Stream). In that case you will have to find newer versions of the libraries.

johnwasser:
WProgram.h has been replaced by Arduino.h so in some of your older installed third-party libraries you will need to make that change. You will get an error like “WProgram.h: no such file”.

There is no “WProgram.h” in my sketch. All the “includes” I have in the program:

#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>;
#include <DallasTemperature.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

But there is file “WProgram.h” in folder …/arduino-0022/hardware/arduino/cores/arduino
There is “Arduino.h” in …/arduino-1.0.3/hardware/arduino/cores/arduino

My sketch compiles and works perfectly on IDE0022 with no errors, but when I open the sketch on 1.0.3 and try to download it, a lot of errors appear:

In file included from HC00_HouseController.pde:21:
/home/housecontroller/arduino-1.0.3/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.h:80: error: conflicting return type specified for ‘virtual void LiquidCrystal_I2C::write(uint8_t)’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Print.h:48: error:   overriding ‘virtual size_t Print::write(uint8_t)’
HC00_HouseController:34: error: cannot declare parameter ‘client’ to be of abstract type ‘Client’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note:   because the following virtual functions are pure within ‘Client’:
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:12: note: 	virtual size_t Client::write(uint8_t)
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:13: note: 	virtual size_t Client::write(const uint8_t*, size_t)
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:14: note: 	virtual int Client::available()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:15: note: 	virtual int Client::read()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:17: note: 	virtual int Client::peek()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:18: note: 	virtual void Client::flush()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:10: note: 	virtual int Client::connect(IPAddress, uint16_t)
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:11: note: 	virtual int Client::connect(const char*, uint16_t)
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:16: note: 	virtual int Client::read(uint8_t*, size_t)
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:19: note: 	virtual void Client::stop()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:20: note: 	virtual uint8_t Client::connected()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:21: note: 	virtual Client::operator bool()
HC00_HouseController:171: error: no matching function for call to ‘Server::Server(int)’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Server.h:4: note: candidates are: Server::Server()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Server.h:4: note:                 Server::Server(const Server&)
HC00_HouseController:171: error: cannot declare variable ‘server’ to be of abstract type ‘Server’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Server.h:4: note:   because the following virtual functions are pure within ‘Server’:
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Print.h:48: note: 	virtual size_t Print::write(uint8_t)
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Server.h:6: note: 	virtual void Server::begin()
HC00_HouseController:172: error: no matching function for call to ‘Client::Client(byte [4], int)’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note: candidates are: Client::Client()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note:                 Client::Client(const Client&)
HC00_HouseController:172: error: cannot declare variable ‘client’ to be of abstract type ‘Client’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note:   since type ‘Client’ has pure virtual functions
HC02_mainloop.pde: In function ‘void loop()’:
HC02_mainloop:31: error: ‘class Server’ has no member named ‘available’
HC02_mainloop:32: error: cannot allocate an object of abstract type ‘Client’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note:   since type ‘Client’ has pure virtual functions
HC50_WEB_server.pde: At global scope:
HC50_WEB_server:4: error: cannot declare parameter ‘client’ to be of abstract type ‘Client’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note:   since type ‘Client’ has pure virtual functions
HC52_WEB_client.pde: In function ‘void connect_main_server()’:
HC52_WEB_client:6: error: no matching function for call to ‘Client::Client(byte [4], int)’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note: candidates are: Client::Client()
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note:                 Client::Client(const Client&)
HC52_WEB_client:6: error: cannot declare variable ‘client’ to be of abstract type ‘Client’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:7: note:   since type ‘Client’ has pure virtual functions
HC52_WEB_client:8: error: no matching function for call to ‘Client::connect()’
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:10: note: candidates are: virtual int Client::connect(IPAddress, uint16_t)
/home/housecontroller/arduino-1.0.3/hardware/arduino/cores/arduino/Client.h:11: note:                 virtual int Client::connect(const char*, uint16_t)
HC92_RTC.pde: In function ‘void get_time()’:
HC92_RTC:6: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:13: error: ‘class TwoWire’ has no member named ‘receive’
HC92_RTC:14: error: ‘class TwoWire’ has no member named ‘receive’
HC92_RTC:15: error: ‘class TwoWire’ has no member named ‘receive’
HC92_RTC:16: error: ‘class TwoWire’ has no member named ‘receive’
HC92_RTC:17: error: ‘class TwoWire’ has no member named ‘receive’
HC92_RTC:18: error: ‘class TwoWire’ has no member named ‘receive’
HC92_RTC:19: error: ‘class TwoWire’ has no member named ‘receive’
HC92_RTC.pde: In function ‘void reset_RTC()’:
HC92_RTC:39: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:40: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:41: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:42: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:43: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:44: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:45: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:46: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:47: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC.pde: In function ‘void store_byte_RTC_mem(byte, byte)’:
HC92_RTC:71: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:72: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC.pde: In function ‘void read_byte_RTC_mem(byte)’:
HC92_RTC:78: error: ‘class TwoWire’ has no member named ‘send’
HC92_RTC:82: error: ‘class TwoWire’ has no member named ‘receive’

Looks like your LiquidCrystal_I2C library is out of date (incompatible with the new Print). Get the new one.

TwoWire (in the Wire library) now uses the standard names write() and read() instead of the old send() and receive().

The Ethernet library changed a bit. I think you might have to use the name EthernetClient instead of Client. Similarly, Server might have to be EthernetServer.

Thanks johnwasser. I managed to update all libraries and correct syntexes in my sketch. Now compiling and uploading ok. The sketch runs fine on Arduino :)

The latest version of Ethernet library fixed also the freezing problem of Ethernet shield. It always freezed after 2000-3000 HTTP requests but the sketch kept running ok. No matter whether receiving or sending HTTP req's, the Ethernet shield always frozed up after few thousand requests.