Originally Posted by
towed
I don't know. I had a problem with my code compiling and after switching the function prototype to the other header file (where the type definition is), it finally compiles. Which would suggest it has to...?
That is the easiest and most obvious way. If you have a header file that you include with function prototypes that contain references to a so far undefined datatype, of course there is an issue. If the header file with prototypes is read in before the actual structure is defined, you can include a structure "prototype" (ie, declaration) with the function prototypes. Eg:
Code:
struct something {
[blah blah]
};
is the definition.
is a declaration with no definition. Since function prototypes do not contain references to struct members, etc, the struct does not have to be defined, it only has to be declared for them to pass the compiler.
Obviously, the struct does have to be fully defined before the functions are, but that could be in a subsequently included file or in a pre-compiled linked object.