problem with include files...
Hello,
I have this files:
main.c
global.h
tc1_task/tc1_task1.c
tc1_task/tc1_task2.c
tc1_task/tc1_task3.c
well, in global.h file I have all my global varibales, and I would like to use in all my task.
But if I make include in all .c files I have the follow error:
main.c:23: multiple definition of `signum'
tc1_task/tc1_task1.c:23: multiple definition of `signum'
tc1_task/tc1_task2.c:23: multiple definition of `signum'
tc1_task/tc1_task4.c:23: multiple definition of `signum'
By other hand I put include file only in main.c file and the other files I declarate all my variables as extern. It works but not with all of them.
For example:
in global.h
typedef struct{
unsigned int contador;
}SHARED_DATA_typ;
SHARED_DATA_typ *shared_data;
And now I would like to use this struct in tc1_task/tc1_task1.c, and I put :
extern SHARED_DATA_typ *shared_data;
it does not work.
any advice????
Best regards
|