DC 9.2 Compiler bug: Local variable

Hello everyone I’ve some problems with variables that I want to be local (private) and who becomes global. The structure of my files looks as follow:

/*** BeginHeader globalFunction1, globalFunction2 /
void globalFunction1 ();
void globalFunction2 ();
/
** EndHeader */

int localVariable;

However the localVariable doesn’t seem to be local. My compiler generates the following error: localVariable previously defined.
This is a bit strange, because the “localVariable” is defined in 2 different .c files. Of course there is a file (main.c) in between who communicates (#use “file1.c”) with the “globalFuntions”. Main.c is not able to use the “localVariable”, just like how it should be.

How can it be that the compiler generates the error? Does anyone know how to solve this?

Haven’t tested it, but there are two things to look at that may solve your problem.
First, check the #class directive. Second, if you aren’t declaring the variable inside a function, it has to be static (global). Take it into a function, and don’t use the static directive for it in the function and it shouldn’t be global.

Thanks for the reply. I rebuild a small piece of code and it had no problem at all. The private variable that became global is in an interrupt function so maybe that has something to do with the problem. :confused: