delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/22/22:27:15

From: Riddler02 AT aol DOT com
Message-ID: <77.1b59be2.25e49eec@aol.com>
Date: Tue, 22 Feb 2000 21:24:44 EST
Subject: d_button_proc - errors in C++, but not C?
To: djgpp AT delorie DOT com
MIME-Version: 1.0
X-Mailer: AOL 4.0 for Windows 95 sub 38
Reply-To: djgpp AT delorie DOT com

hello once again,

Now that I have begin exploring the wonderful world of Allegro GUI functions, 
I have come across a slight problem.  The Allegro GUI example program, EX13.C 
(which is located in C:\DJGPP\ALLEGRO\EXAMPLES for me) compiles n' links and 
runs perfectly.  However, if I change its name to EX13.CPP (or anything.cpp 
for that matter), I get the following error at every occurrence of the 
d_button_proc function when I try to compile:
    
    Error: initialization to "void *" from "const char *" discards qualifiers.

For example, a program with the .CPP extention containing the following 
dialog would compile fine

    DIALOG main_dialog[] = 
        { d_clear_proc, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL  },
          NULL, (blah blah 
blah...........................................................) }
        };

but a dialog with d_button_proc won't

    DIALOG main_dialog[] = 
        { d_clear_proc, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, NULL, NULL, NULL  },
          d_button_proc, numbers 
numbers.........................................  },          
          NULL, blah blah 
blah...........................................................  }
        };

It would seem that I need to typecast something here, as is the case with 
many C/C++ compatability issues, but I don't know what - pleez help!

-Kevin

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019