Newsgroups: comp.os.msdos.djgpp From: tob AT world DOT std DOT com Subject: Re: need help with d_bitmap_proc (Allegro) Message-ID: Sender: tob AT world DOT std DOT com (Tom Breton) Reply-To: tob AT world DOT std DOT com Organization: BREnterprises References: <350F532D DOT C6DBA305 AT pangea DOT ca> Date: Thu, 19 Mar 1998 00:12:15 GMT Lines: 28 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Lee 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