Problem with global variables at different files (extern)

Hi, I have problems with global variables. I wrote a library for my application and in the header file I declared a variable like "byte ChipCount". In the cpp-file I redeclared the variable "extern byte ChipCount". In my main-file I don't use the variable. For using it in the main-file I wrote the functions byte GetChipCount() and void SetChipCount(byte);

Now the compiler says "multiple definition of `ChipCount'" and I can't explain that.

Thanks for help!

Greetings

I think you have it backwards, use extern in the header file, but not in the cpp-file.

http://stackoverflow.com/questions/1433204/what-are-extern-variables-in-c

Thanks a lot. You are right!