HELP!!! Counters, global variables, and the like

Well, here’s a question with an answer that’s probably very obvious. How do I create a counter used by both the default routine and process IO functions? I tried declaring a global variable, but MPLAB had a major case of PMS when I did. Perhaps I’m doing it wrong? Below the includes, I simply declared
int counter=0;
Is there a better way of doing this?
Also, how do I pass values between functions? Once again, the compiler gets testy
This is urgent, as we ship in 2 days

well… if they are in separate files, you need to declare it in each file… do

int count=0;

in one file, then do

extern int count;

in all the others.

dont forget you get to work on programing after you ship