I've written this memo after I needed to use WIShield with Arduino 1.0 and Arduino 1.0.1 IDE

First time I tried to compile a sketch I received the following errors:

In file included from SimpleServer.cpp:6: C:\Users\ldandrea\Desktop\arduino-1.0.1\libraries\WiShield/WiServer.h:198: error: conflicting return type specified for 'virtual void Server::write(uint8_t)' C:\Users\ldandrea\Desktop\arduino-1.0.1\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'


The WiShield library is a library developed to interface the WiShield1 and WiShield2.0 (AsyncLabs) shields to Arduino. It gives you the capability to connect to a hotspot, send and receive UDP or TCP messages and much more.

The problem is that the source code of this library has been written several years ago, in the meanwhile, the Arduino IDE has been updated several times, and, now, when you compile the library you will receive some errors.

To compile the library you have to do some simple changes.

  • Download the library from this link https://github.com/asynclabs/WiShield
  • Create the directory arduino-1.0.1\libraries\WhiShield into the Arduino Directory
  • Extract the zip file and copy the contents into the arduino-1.0.1\libraries\WhiShield directory 
  • Open the clock-arch.c file and change

#include "wiring.h"

into 

#include "Arduino.h"


  • Open the WiServer.cpp file and change

#include "WProgram.h"

into

#include "Arduino.h"

and

void Server::write(uint8_t b) {

into

size_t Server::write(uint8_t b) {


  • Open the WiServer.h file and change

virtual void write(uint8_t);

into

virtual size_t write(uint8_t);


  • Open the WiShield.cpp file and change

#include "WProgram.h"

into

#include "Arduino.h"

 

Now the library should compile.


I've checked these changes on Mac OS X, Windows and Linux with Arduino 1.0 and Arduino 1.0.1


Gg1