This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/linker tries to redefine global variable

Hi. I'm using C6000 compiler.

I'm trying to compile a project where I have the files and sample content:

utility.h:

int globalvar;


utility.c:

#include utility.h

void func1() {

 globalvar = 1;

}


main.c:

#include utility.h

int main(void) {

 ...

}


in the linking process it gives the error:

error #10056: symbol "globalvar" redefined: first defined in "./src/main.obj"; redefined in "./src/utility.obj"

I have this same code compiled for other processors, and they link fine.

How do I tell C6000 not to try redefine the global vars?

Thanks in advance.