How are you compiling your code? On the web IDE or CLI or locally with gcc/make?
You could be running into problems with the Arduino/Spark preprocessor that tries to make C/C++ easier for novice programmers but screws up classes etc.
If that is the problem, you can turn it off with a pragma at the top of your file:
#pragma SPARK_NO_PREPROCESSOR #include "application.h"
You will have to supply function prototypes and make sure any forward references are in the correct order since you are now using straight C.