I am two C files in a project. 1. main.c 2. rtc.c and third one is header file for both in which all prototypes are defined.
I want to use a bit variables named aon and aoff in both files. Now three condition arises
1. i declare extern bit aon,aoff; in header file but it gives error
//ERROR L104: MULTIPLE PUBLIC DEFINITIONSERROR L104: MULTIPLE PUBLIC DEFINITIONSERROR L104: MULTIPLE PUBLIC DEFINITIONSextern bit aon=0,aoff=0;
2. i declare extern bit aon,aoff; in onlyin main file but it gives error
aon and aoff not declared in rtc; and vice versa
3. i declare in both c files than again i gives error
Why?