error: array type has incomplete element type
Hi,
I'm getting this error when I tried to compile the program in Linux platform.
'error: array type has incomplete element type'
It works fine in AIX and was able to successfully compile, but not in Linux.
Here's a part of the code:
#ifdef MAIN_PROG
struct COMPETITOR competitor[MAX_SIZE];
struct COMPETITOR competitor_sav[MAX_SIZE];
.
.
.
#else
.
.
extern struct COMPETITOR competitor[];
extern struct COMPETITOR competitor_sav[];
#endif
Any input on this? Thanks.
error: array type has incomplete element type
Thanks cas for your response.
What do you mean by the source of the gcc error is lack of a struct defition? If it lack of a struct definition, how it can be defined then based on the provided code? Please advise. Thanks again.
error: array type has incomplete element type
Thanks Adak for your response.
Yes the MAX_SIZE has been defined in the code.
#define MAX_SIZE 1000.
The program has been successfully compiled in AIX, and it's working fine. However, when I tried to compile in Linux, I'm getting this error. So I'm not sure if there's a compatibility issue or whatever. Please advise. Thanks.
error: array type has incomplete element type
The struct is defined outside the MAIN_PROG.
I am wondering why the same code has been successfully compiled in AIX and is working fine. The problem is in Linux, I'm getting the compile error in Linux.