You define a typedef for struct path, then you later define struct Path. Because C is case sensitive, these are seen as two separate types.

The way you have it now, you declared struct path (with Path as an alias) but haven't defined it. So when you try to dereference a Path *, the compiler doesn't know what that struct looks like because you haven't told it.

What you want is:

typedef struct Path Path;

Email codedump link for &quot;dereferencing pointer to incomplete type” in a struct pointer