Steve Church

how to declare a struct as external in header file CW5.1

Discussion created by Steve Church on Dec 28, 2007
Latest reply on Dec 29, 2007 by CompilerGuru
I have set up a simple struct of bits
struct{
    unsigned char flag1:1
    unsigned char flag2:1
    unsigned char flag3:1
}flags;

I have put this in the (main.h) header. How do I make this struct visible to other files. I already include the (main.h) file in the relevant .c files.
I use the #ifdef
                variable1;
                variable2;
                (struct will go in here)
      
                #else
                extern variable1;
                extern variable2;
                (how do I get struct to show itself?)
                #endif
for the form of the header file.
Can I do "extern struct flags;"?
I have tried various things but always get compiler errors

Outcomes