468,512 Members | 1,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

array type has incomplete element type

Hi All,

--------------------------------------------------------------------------------
This is a part of the code :
--------------------------------------------------------------
extern struct dummy temp[];
error: array type has incomplete element type
--------------------------------------------------------------
which i compiled without any error on :
$gcc -v
Reading specs from /usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0
/2.9-aix51-020209/specs
gcc version 2.9-aix51-020209
but the same code doesnt compile on the :

$gcc -v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/
bin/
ld
--disable-nls --enable-languages=c,c++ --prefix=/opt/freeware
--enable-threads --enable-version-specific-runtime-libs
--host=powerpc-ibm-aix5.3.0.0
Thread model: aix
gcc version 4.0.0

Please suggest me the arguments I must give to gcc 4.0 to get the
above code compiled.

Shravan
PS : I have already gone through the article :
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_047.html>.
the code I am compiling is large and it is difficult to change it
now.
Please suggest me something that GCC 4.0 has for backward
compatibility.
Jan 17 '08 #1
1 16225
sh********@gmail.com wrote:
This is a part of the code :
--------------------------------------------------------------
extern struct dummy temp[];
error: array type has incomplete element type
--------------------------------------------------------------
Please suggest me the arguments I must give to gcc 4.0 to get the
above code compiled.
There are none. You must complete the element type of the array. IOW,
you must define struct dummy before you declare an array of struct
dummy. Unless you have done that, the error message is correct.

Richard
Jan 17 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Paul F. Dietz | last post: by
6 posts views Thread by Eric Smith | last post: by
22 posts views Thread by Neo | last post: by
10 posts views Thread by Adam Warner | last post: by
204 posts views Thread by Alexei A. Frounze | last post: by
21 posts views Thread by rupesh_533 | last post: by
26 posts views Thread by Adam Warner | last post: by
3 posts views Thread by Hallvard B Furuseth | last post: by
10 posts views Thread by arcadio | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.