LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Array type has incomplete type (https://www.linuxquestions.org/questions/programming-9/array-type-has-incomplete-type-590726/)

gopal229 10-10-2007 03:08 AM

Array type has incomplete type
 
hi all
i m using Suse 10.2, my gcc complier version is 4.1.2. while compiling the code ffmpeg source code i am getting error as "Array type has incomplete type". can any one suggest me how to rectify that error.

Tinkster 10-11-2007 12:39 PM

Hi, and welcome to LQ!

Probably not w/o having seen the faulty code.


Cheers,
Tink


P.S.: This question is better of in our programming forum,
and I'm moving it there.

ta0kira 10-13-2007 03:23 PM

Normally that error only occurs when you declare a struct/class without defining it then try to construct something with it:
Code:

struct my_struct;

void function1()
{ my_struct my_incomplete_array[10]; }

struct my_struct {};

void function2()
{ my_struct my_complete_array[10]; }

This is because without the structure definition the compiler doesn't know what size it is, and therefore doesn't know how to line up stack offsets when referencing variables, etc.
ta0kira

gopal229 10-16-2007 12:23 AM

pls go thru the code
 
the following is a piece of code, where i am getting error"Array type has incomplete type" in line 3 &7

struct AVOption;
#ifdef HAVE_MMX
extern const struct AVOption avoptions_common[3 + 5];
#else
extern const struct AVOption avoptions_common[3];
#endif
extern const struct AVOption avoptions_workaround_bug[11];


All times are GMT -5. The time now is 10:15 AM.