Mail Archives: djgpp/1998/03/18/20:09:40
Lee <jag*NOSPAM*@pangea.ca> writes:
> However, the following code produces the error:
> initializer element for `main_dialog[5].dp' is not constant
>
> *code*
> DIALOG main_dialog[] =
> {
> /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key)
> (flags) (d1) (d2) (dp) */
> ...some stuff....
> { d_bitmap_proc, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, mydat[LOGO].dat},
> ...some other stuff
> };
> *end code*
It means what it says, the initializer for `main_dialog[5].dp'...
> { d_bitmap_proc, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, mydat[LOGO].dat},
^^^^^^^^^^^^^^^ main_dialog[5].dp
...is not constant. And it isn't. The compiler can't reduce
mydat[LOGO].dat to a constant pointer at compile time. You have to
initialize that element by hand.
Tom
- Raw text -