Hi.
A good rule of thumb to stick to is to never write source in a header file that would generate machine code and/or take up storage.
You should only put macrodefinitions, type definitions, function prototypes, extern declarations etc. in a header file (none of the above will generate machine code or take up memory).
Additionally, at the beginning of every "header.h" put a
Code:
[COLOR="#006400"]#ifndef[/COLOR] _HEADER_H_
[COLOR="#006400"]#define[/COLOR] _HEADER_H_
and then you end the file with
Code:
[COLOR="#006400"]#endif[/COLOR] [COLOR="gray"]// #ifndef _HEADER_H_[/COLOR]
(You'll change the definition above to match your file name.)
This way you will prevent multiple inclusions of the same header file.
In your particular case I think you both inlcuded the file with the variable declarations and declared them as external to this module, so the compiler is confused.
In general, if you declare variables or write source that translates to machine code in a header file, that code will be duplicated everytime you include that particular header file. So you'll most likely get an error if don't adhere to the rules above and include a file multiple times.
Arthur