I strongly suggest first working in the particle.io IDE at https://build.particle.io and copying include.h and include.cpp files into the IDE. This method is a pain to setup but makes development much ...
I have the same error within libraries unless I include Arduino.h. Not sure if this is intended, not sure if Arduino.h Includes the register definitions but I think ...