Re: Help w/ "incomplete type" error
- From: rlb@xxxxxxxxxxxxxxxxxxxxxx (Richard Bos)
- Date: Wed, 06 Jul 2005 12:49:44 GMT
kj <socyl@xxxxxxxxxxxxxxxxx> wrote:
> Hi. I'm trying to compile some software from source, and I'm
> getting an error I can't figure out. The error in question is
>
> key_events.h:38: field `id' has incomplete type
> struct kb_event_map_s {
> char prefix[8];
> const kb_event_id_t id[];
> };
> I can't spot the error.
The error is precisely what the error message told you: the field called
id, in the struct called kb_event_map_s, has incomplete type. Variable-
length arrays are valid only in C99, and you're probably using a C89
compiler, so you can't do this. You must give id some specific size. If
you need a variable-length array, you can either find a C99 compiler, or
make id a pointer and use malloc().
Richard
.
- References:
- Help w/ "incomplete type" error
- From: kj
- Help w/ "incomplete type" error
- Prev by Date: Re: will the memory allocated by malloc get released when program exits?
- Next by Date: Re: Help w/ "incomplete type" error
- Previous by thread: Help w/ "incomplete type" error
- Next by thread: Re: Help w/ "incomplete type" error
- Index(es):
Relevant Pages
|
|