help with old prog

Hello, I am trying to get an old C++ program to compile.... it uses bits of Motif so I'm doing it with MinGW/g++ in cygwin with X11 routines installed.... that seems to be working OK, but I can't compile it for the following error:

error: invalid conversion from ‘const void*’ to ‘void*’

Is that a golden oldie?? Anyhow, the offending bit of code is the last line of this....

void fuse_dialog(Widget w)
{
Widget dialog, rc;
XmString string;
Arg args[5];
int n = 0;
static ActionAreaItem action_items[] = {
{ "OK", fuse_ok_pushed, NULL },
{ "PICK AGAIN", pickagain_pushed ,NULL },
{ "QUIT", fuse_cancel_pushed, NULL },
{ "Help", help, "Help Button" },
};

Fraid I'm not a programmer and I don't have access to local expertise. I just want to get it running... (sorry if that doesn't sound responsible!!).

Any clues very much appreciated indeed.

Bests for now, bat.
Show the definition of ActionAreaItem.
Cheers Vlad, I've searched the c++ and helper files and I think this is it, but not sure....

struct ActionAreaItem{
char *label;
void (*XtCallbackProc)(Widget w,XtPointer client_data,XtPointer call_data);
XtPointer data;
};

... this is a nightmare!
Well, what is the type of XtPointer?

I want to know what object has type void * and whta object has type const void *

You should show the whole error message. Usually such a message contains additional messages that point to object that can not be assigned.
Awesome..... here's the rest of the error message (there are others like this but they all have the same pattern)

drawwindow.c++: In function ‘void fuse_dialog(_WidgetRec*)’:
drawwindow.c++:663:5: warning: deprecated conversion from string constant to ‘char*’
drawwindow.c++:663:5: warning: deprecated conversion from string constant to ‘char*’
drawwindow.c++:663:5: warning: deprecated conversion from string constant to ‘char*’
drawwindow.c++:663:5: warning: deprecated conversion from string constant to ‘char*’
drawwindow.c++:663:5: error: invalid conversion from ‘const void*’ to ‘void*’

As for XtPointer, there is no obvious definition in the files I have, but Google gives the following....

XtPointer is a void* used by X Windows.
The generating of warnings is clear because string lliterals have type const char [] and inside the structure they are assigned to char * instead of const char *. As for void * and const void * I do not see where this conversion is being done.

And I do not understand why you search Google when you have to have include files. Why do you not look through your include files?!
Last edited on
Topic archived. No new replies allowed.