I am possibly doing this incorrectly and this is much a question about why it works in one compiler and not the other.
I have a large C application, and I am
The ubuntu compiler is being overly soft; you can't typedef the same thing twice. In the style you refer to, the ordering of the includes is important, and is usually mentioned as a comment in the header file, or in the documentation. In this case, you would have:
//A.h
typedef struct A A;
struct A {
double a;
B* b;
};
// B.h
typedef struct B B;
struct B {
int c;
};
// C.h
void function_do_something(A*, B*);
// C.c
#include "B.h"
#include "A.h"
#include "C.h"
void function_do_something(A* a, B* b){ ... }
You might note that this will get messy in the case of cyclic dependancies.