[comp.windows.x.motif] illegal pointer/int combination

jka@mris.larc.nasa.gov (J. Keith Alston) (05/23/91)

Greetings,
    on compilation of a MOTIF program I get the following warning,

    "program.c",line 65:warning:illegal pointer/integer combination,op=

    line 65 in the program is,
    menubar=XmCreateMenuBar(form,"menubar",wargs,n);

    menubar is defined as a Widget.
    does anyone out there know what this error is caused by or how I can
    get rid of it. I guess XmCreateMenuBar is generating an integer value
    and menubar is a pointer type? Also how can I specify the width of
    the menubar. specifying XmNwidth doesn't seem to work.

-- 
"In this world you must be OH so smart or OH so pleasant...
			 I recommend pleasant"----> Elwood P. Dowd
Lockheed Eng. and Sci. Co./Nasa Larc|J. Keith Alston jka@snow.larc.nasa.gov

krs0@gte.com (Rod Stephens) (05/23/91)

In article <1991May22.172108.3805@news.larc.nasa.gov> jka@mris.larc.nasa.gov (J. Keith Alston) writes:
>Greetings,
>    on compilation of a MOTIF program I get the following warning,
>
>    "program.c",line 65:warning:illegal pointer/integer combination,op=
>
>    line 65 in the program is,
>    menubar=XmCreateMenuBar(form,"menubar",wargs,n);
>
>    menubar is defined as a Widget.
>    does anyone out there know what this error is caused by or how I can
>    get rid of it. I guess XmCreateMenuBar is generating an integer value
>    and menubar is a pointer type? Also how can I specify the width of
>    the menubar. specifying XmNwidth doesn't seem to work.

My favorite way to generate this error is to forget to
#include the header file that goes with the XmCreateWhatever
function. Then C assumes the function returns an integer so
it doesn't like setting <the widget menubar> = <an integer>.

In this case you need:

#include <Xm/RowColumn.h>

+---------------------------------------------------------------+
| Rod Stephens           | "Haven't I told you not to play      |
| GTE Laboratories, Inc  |  with my super-weapons? You might    |
| (617)466-4182          |  devastate yourself!"                |
| krs0@gte.com           |                                      |
+---------------------------------------------------------------+

jka@mris.larc.nasa.gov (J. Keith Alston) (05/23/91)

In article <1991May22.172108.3805@news.larc.nasa.gov> jka@mris.larc.nasa.gov (J. Keith Alston) writes:
>Greetings,
>    on compilation of a MOTIF program I get the following warning,
>
>    "program.c",line 65:warning:illegal pointer/integer combination,op=
>
>    line 65 in the program is,
>    menubar=XmCreateMenuBar(form,"menubar",wargs,n);
>
>    menubar is defined as a Widget.
>    does anyone out there know what this error is caused by or how I can
>    get rid of it. I guess XmCreateMenuBar is generating an integer value
>    and menubar is a pointer type? Also how can I specify the width of
>    the menubar. specifying XmNwidth doesn't seem to work.
>

Thanks to all the people who responded to this question.
I've added the required header files and that solved the problem

-- 
"In this world you must be OH so smart or OH so pleasant...
			 I recommend pleasant"----> Elwood P. Dowd
Lockheed Eng. and Sci. Co./Nasa Larc|J. Keith Alston jka@snow.larc.nasa.gov

dealy@kong.gsfc.nasa.gov (Brian Dealy - CSC) (05/24/91)

-- 
I have run across this myself in coding and now
I generally look to see if I have included the
header file for the Widget I am creating since
this contains the prototype for the
XmCreateMenuBar or whatever routine you are calling.
try putting...
#include <Xm/MenuShell.h>
at the top... the Motif Programmers reference 
lists which includes are needed on the 
pages describing the create rotuine you are using.

Of course we dont all have those manuals...


Brian dealy

root@shawn.uucp (0000-Admin(0000)) (05/24/91)

jka@mris.larc.nasa.gov (J. Keith Alston) writes:

>Greetings,
>    on compilation of a MOTIF program I get the following warning,

>    "program.c",line 65:warning:illegal pointer/integer combination,op=

>    line 65 in the program is,
>    menubar=XmCreateMenuBar(form,"menubar",wargs,n);

>    menubar is defined as a Widget.
>    does anyone out there know what this error is caused by or how I can
>    get rid of it. I guess XmCreateMenuBar is generating an integer value
>    and menubar is a pointer type? Also how can I specify the width of
>    the menubar. specifying XmNwidth doesn't seem to work.

You are probably missing the header file for that widget.  Check the man
page to see what header file it requires.