gcc - C Field has incomplete type, without forward declaration -
i keep getting "field has incomplete type error," can't find forward declarations type in code, or of types in it's struct--aside pointer fields. tried recursive grep folder, , still couldn't find forward declarations.
how make gcc tell me thinks forward declaration is? or why it's incomplete?
trying compile file:
https://github.com/pdjeeves/creatureslib/blob/master/src/biochemistry/emitter.c
gets error on include:
https://github.com/pdjeeves/creatureslib/blob/master/src/creature/creature.h
with member
"struct brain brain"
your brain.h
, organ.h
both start
#ifndef _organ_h_ #define _organ_h_
this means second 1 not included after include first one.
it's unusual used #ifndef _something_h_
@ several places inside brain.h
. should include relevant headers, instead of redefining contents. i.e. #include lobe.h
, instead of declaring empty forward declaration struct brainlobe;
.
Comments
Post a Comment