This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

about extern struct question.

dear all, i defind a struct in a head file and other file will be use this struct , i use keyword extern but always has warning or error message , please tell me really method. thanks a lot.

main.c
----------------
typedef union{
        unsigned char Byte;
        struct{
                unsigned _40:1; //Cmd 0
            unsigned _41:1;     //Acmd 41
            unsigned _50:1;     //Cmd 16
            unsigned _49:1;     //Cmd 9
            unsigned b4:1;
            unsigned b5:1;
            unsigned b6:1;
            unsigned b7:1;
        }Audio;
        struct{
                unsigned _51:1; //Cmd 17 read_single_block
            unsigned _58:1;     //Cmd 24 write_single_block
            unsigned xx1:1;     //Cmd 16
            unsigned xx2:1;     //Cmd 9
            unsigned xb4:1;
            unsigned xb5:1;
            unsigned xb6:1;
            unsigned xb7:1;
        }Bits;
}_Data;

_Data init_flag;

other.c
----------------------------------
extern struct _Data init_flag;

0