The Arduino IDE automatically adds this line to your sketch:
#include <Arduino.h>
Did you add that line to your code?