#include libraries in files other than main

If it is a seperate class, you will need to add the line:

#include "Arduino.h"

In order to get the type definitions. This is not needed in the sketch because the sketch is I believe an extension of main.cpp which already includes Arduino.h