I am making a class which involves implementing a protocol. But after 2 days of googling and trying to find the solution I have come here as my last hope.
Can you post the complete compiler output? Usually it would include line numbers.
Also, please give links to any non-standard libraries you're using.
Was that the source for FSM.h? Why was it #including FSM.h? Is states defined as a type somewhere?
I suggest you turn on verbose output during compilation, see what the temporary directory is and see what .cpp source the IDE has generated for your sketch. The IDE's code mangler is pretty dumb and could easily have screwed up your template declaration.
In file included from Client.ino:2:
FSM.h:20: error: ISO C++ forbids declaration of 'list' with no type
FSM.h:20: error: invalid use of '::'
FSM.h:20: error: expected ';' before '<' token
Here is a full error from Arduino IDE. I actually use Atmel studio for developing applications and he doesn't print line number. Why can't i declare a list?