Just to save some hair-pulling using the MPLAB XC8 C Compiler, the interrupt directive is proceeded with a double underline, not a single. The two underlines together look like one wide underline. And of course, like many other compilers, MPLAB was pointing the error at unrelated lines of code. Took me all day to figure this out. Isn't the learning curve fun?
void _interrupt myisr(void) WRONG
void __interrupt myisr(void) RIGHT
Bob D.
void _interrupt myisr(void) WRONG
void __interrupt myisr(void) RIGHT
Bob D.