Member access into incomplete type error
Solution 1:
You're asking for a member in the FooEncoder
struct which isn't visible anywhere in your foo_interface.cc file. This looks similar to a pimpl idiom.
In order to have your code aware of FooEncoder
's structure you need to either
#include "foo_encoder.c"
in your foo_interface.cc file (I quite don't like this solution and you didn't post the full code either) or move your struct definition elsewhere in a header file and include that one (recommended).
Solution 2:
foo.h is declaring a type definition to a struct that is only defined in foo.c, so foo_interface.cc has no visibility as to what FooEncoder actually is. You can fix this by moving the struct definition from foo_encoder.c to foo.h.