When compile an Arduino Library, it fails to compile with the message:
error: WConstants.h: No such file or directory
The solution is to delete the line
#include "WConstants.h"
and then in the .h file, add the following:
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
This way, the code will compile, and it will be compatible to Arduino 0023 and 1.0 versions.