I have this situation:
A.h and B.h
In A.h:
typedef struct TypeA TypeA_t;
struct TypeA {
...
TypeA_t *a;
void (*doSomething)(TypeB_t *);
};
In B.h:
typedef struct TypeB TypeB_t;
struct TypeB {
...
TypeB_t *b;
TypeA_t something;
};
What is the correct way to include header files in each file?
If I include A.h in B.h and B.h in A.h I get:
error: unknown type name 'TypeB_t' in A.h
and
error: unknown type name 'TypeA_t' in B.h
I found a similar question here but it doesn't work in my case.