Hello Geek19
The define statement you mentioned protects a single compilation unit (single .c file) from including the multiple definitions of the same header file.
I assume you are able to compile but there is a linker error right?
Can you double check if the header files included does not contain any object definition?
e.g. "thisfile.h":
--------------------
#idndef _THISFILE_
#define _THISFILE_
...
int my_object = 10;
...
#endif
In such particular case "my_object" is allocated in each .c file that includes thisfile.h.
Regarding the extern struct see the example below that should work:
e.g. "thisfile.h":
--------------------
#idndef _THISFILE_
#define _THISFILE_
...
typedef struct
{
int a;
int b;
}tMyStruct;
extern tMyStruct my_struct;
// header file includes just extern declaration ( type tMyStruct must be available in .h file or included from separate .h file)
...
#endif
thisfile.c
-----------
#include "thisfile.h"
tMyStruct my_struct; // here the memory is allocated to the struct variable
...
If this does not help please post some code snippets...
Stanish