I have a struct which is beeing included to other struct in other modules, such as StructA.StructB.ElementofB is possible. This is done for multiple modules, and each module has the .h file of structB included. But for some reason am i getting compiler errors which says that structB is an undefined type, eventthoug i in my IDE can see that it is declarated correctly. Why is it saying that the type is undefined eventhough i've included the .h file??
Guest
#3635313
John Mayer wrote: > I have a struct which is beeing included to other struct in other Maske an example of the complex struct with same datatypes!
typedef struct{
int start;
int stop;
int lap;
} a;
typedef struct{
a A
int car;
int postal;
} loser;
typedef struct{
a A
int don;
int son;
} more;
each struct is in it's own .h file. i've just included .h of struct a on
all them.
I can't find a mistake in the example, i think the problem is somewere else. How is the exact structure of the files, in which order are #include and #ifdef - #endif and in which files? Try to preprocess the files only, then something may be clearer. (gcc -E file.c)
Guest
#3635714
Daniel A. wrote: > I can't find a mistake in the example I can! What about a semikolon after the "a A" line ?
Well. that's just because i just wrote some random ones here.. they are added in my code.
Guest
#3638460
John Mayer wrote: > Well. that's just because i just wrote some random ones here.. > they are added in my code. You are not supposed to write some random code for this posting, but something that you tried and that actually contains the problem you're experiencing.
Reply
Please log in before posting.