I have a variable that is a struct, defined in a .c file:
struct {
int write_cursor;
int read_cursor;
message messages[10];
} out_messages = {0, 0};
To make it available in other files I have an .h file with:
extern struct {
int write_cursor;
int read_cursor;
message messages[10];
} out_messages;
This worked with the Microchip C18 compiler. The XC8 compiler gives an error:
communications.c:24: error: type redeclared
communications.c:24: error: conflicting declarations for variable "out_messages" (communications.h:50)