[comp.windows.x.motif] Problems compiling a 3 line Motif program!!!

dcb@dave.mis.semi.harris.com (Dave Brillhart) (06/03/91)

I've finally found time to start programming in the wonderful
world of Motif.  A friend recommended the Marshall Brain
Tutorials (a great tip).  I can't seem to get the first "Hello World"
program to compile... I'm sure it's some kind of setup problem.
(BTW, I can compile most other x programs except mxrn. The
only commonality I could find was mxrn also uses <Xm.h>.)

I'm running Ultrix 4.1 on a DECstation 5000. I loaded OSF/Motif
1.1. That MAY be the problem right there - I've read 4.1 is based
on R3 intrinisics while Motiif 1.1 is R4???  Any conformation on
that? What follows is the program and error message (same thing
happens with or without the commented lines):

Thanks in advance for and comments,
   Dave Brillhart
   Harris Semiconductor
   Melbourne, FL
=======================================================
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#include <Xm/Label.h>

main(int argc, char *argv[])
{
  Widget toplevel;  Arg al[10];  int ac=0;

  toplevel = XtInitialize(argv[0],"",NULL,0,&argc,argv);
/*
 
XtSetArg(al[ac++],XmNlabelString,XmStringCreate("hello",XmSTRING_DEFAULT
T_CHARSET));
  msg = XtCreateManagedWidget("msg",xmLabelWidgetClass,toplevel,al,ac);
*/
  XtRealizeWidget(toplevel);
  XtMainLoop();
}
===========================================================
ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2017: syntax error
      typedef XtPointer (*XmResourceBaseProc)();
      -------------------^
ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2017: function returns
illegal type
      typedef XtPointer (*XmResourceBaseProc)();
      -----------------------------------------^
ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2020: syntax error
          XmResourceBaseProc  base_proc;
      ---------------------^
(ccom): /usr/lib/DXM/lib/Xm/Xm.h, line 2020: cannot recover from earlier
errors: goodbye!
          XmResourceBaseProc  base_proc;
      ----------------------------------^

dbrooks@osf.org (06/03/91)

In article <1991Jun3.124344.4245@mlb.semi.harris.com> you write:
|> I'm running Ultrix 4.1 on a DECstation 5000. I loaded OSF/Motif
|> 1.1. That MAY be the problem right there - I've read 4.1 is based
|> on R3 intrinisics while Motiif 1.1 is R4???  Any conformation on
|> that?

If DEC is shipping Motif 1.1, they'll be shipping X11R4 Intrinsics.  There
Is No Alternative.

|> What follows is the program and error message

But you omitted the "cc" command :-)

|> ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2017: syntax error
|>       typedef XtPointer (*XmResourceBaseProc)();
|>       -------------------^

(etc...)

At 1.1.1, we (finally) implemented full ANSI prototyping.  Although the
Ultrix MIPS cc does prototyping, it doesn't quite match the ANSI
requirements.

If you add "-D_NO_PROTO" to your cc line, you'll be able to get over this
hurdle.  You might like to hack it into your imake templates, or even (I
don't recommend this) your local Xm.h.

I believe a Sun cc has the identical problem.
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks

klee@wsl.dec.com (Ken Lee) (06/03/91)

In article <1991Jun3.124344.4245@mlb.semi.harris.com>, dcb@dave.mis.semi.harris.com (Dave Brillhart) writes:
|> ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2017: syntax error
|>       typedef XtPointer (*XmResourceBaseProc)();
|>       -------------------^

This is a common problem for people compiling programs on systems
supporting multiple versions of the X Toolkit.  On DECstations, the Xt
include files in /usr/include/X11 are for the XUI intrinsics.  The
Motif intrinsics (X11R4) include files are in /usr/lib/DXM/lib/Xt/X11
(DXV instead of DXM for VAXes), so you should put a
-I/usr/lib/DXM/lib/Xt in your Makefile.

-- 
Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee

dbrooks@osf.org (06/04/91)

In article <1991Jun3.090241@wsl.dec.com>, klee@wsl.dec.com (Ken Lee) writes:
|> include files in /usr/include/X11 are for the XUI intrinsics.  The
|> Motif intrinsics (X11R4) include files are in /usr/lib/DXM/lib/Xt/X11
|> (DXV instead of DXM for VAXes), so you should put a
|> -I/usr/lib/DXM/lib/Xt in your Makefile.

And I wrote:
|> If you add "-D_NO_PROTO" to your cc line, you'll be able to get over this
|> hurdle.

I prefer Ken's answer :-)

It seems that DEC's product does not have the problem to which I was
referring, if you do the right thing.  My advice still holds if you are
using our generic source, 1.1.1 or greater, and MIPS cc 1.31.  Here, I get
the following errors with prototyping on; they are not the same as those
originally posted:

ccom: Error: /usr/include/Motif1.1.1/Xm/Xm.h, line 1764: redeclaration of XmColorProc
      XmColorProc XmSetColorCalculation(XmColorProc proc);
      --------------------------------^
ccom: Error: /usr/include/Motif1.1.1/Xm/Xm.h, line 1764: syntax error
      XmColorProc XmSetColorCalculation(XmColorProc proc);
      --------------------------------^
ccom: Error: /usr/include/Motif1.1.1/Xm/Xm.h, line 1765: redeclaration of XmColorProc
      XmColorProc XmGetColorCalculation(void);
      --------------------------------^
ccom: Error: /usr/include/Motif1.1.1/Xm/Xm.h, line 1984: syntax error
          XmResourceBaseProc    base_proc;
      ---------------------^
(ccom): /usr/include/Motif1.1.1/Xm/Xm.h, line 1984: cannot recover from earlier errors: goodbye!
          XmResourceBaseProc    base_proc;
      ----------------------------------^
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks

yzarn@lhdsy1.chevron.com (Philip Yzarn de Louraille) (06/06/91)

In article <1991Jun3.124344.4245@mlb.semi.harris.com> dcb@dave.mis.semi.harris.com (Dave Brillhart) writes:
>I've finally found time to start programming in the wonderful
>world of Motif.  A friend recommended the Marshall Brain
>Tutorials (a great tip).  I can't seem to get the first "Hello World"
>program to compile... I'm sure it's some kind of setup problem.
>(BTW, I can compile most other x programs except mxrn. The
>only commonality I could find was mxrn also uses <Xm.h>.)
>
>I'm running Ultrix 4.1 on a DECstation 5000. I loaded OSF/Motif
>1.1. That MAY be the problem right there - I've read 4.1 is based
>on R3 intrinisics while Motiif 1.1 is R4???  Any conformation on
>that?
>
>===========================================================
>ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2017: syntax error
>      typedef XtPointer (*XmResourceBaseProc)();
>      -------------------^
>ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2017: function returns
>illegal type
>      typedef XtPointer (*XmResourceBaseProc)();
>      -----------------------------------------^
>ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2020: syntax error
>          XmResourceBaseProc  base_proc;
>      ---------------------^
>(ccom): /usr/lib/DXM/lib/Xm/Xm.h, line 2020: cannot recover from earlier
>errors: goodbye!
>          XmResourceBaseProc  base_proc;
>      ----------------------------------^
Yes, Ultrix 4.1 is X11R3 but the X librairies delivered with the
software are *supposed* to be X11R4 compatible (?, what is that supposed
to mean?)
Motif 1.1 is X11R4. The third error signifies that the compiler does not
know anything about XmResourceBaseProc. Probably because it is only
found in R4 of X. Why don't you try *linting* your code before compiling
it, you may get more detailed messages. (I always lint before I compile,
saves me lots of time.)
-- 
  Philip Yzarn de Louraille                 Internet: yzarn@chevron.com
  Research Support Division                 Unix & Open Systems
  Chevron Information & Technology Co.      Tel: (213) 694-9232
  P.O. Box 446, La Habra, CA 90633-0446     Fax: (213) 694-7709

david@lta.lta.com (06/10/91)

> But you omitted the "cc" command :-)

Yes; the problem is that the default header files are R3. The R4 ones are
tucked somewhere else on the system, if they're present. Find them and use -I.

> |> ccom: Error: /usr/lib/DXM/lib/Xm/Xm.h, line 2017: syntax error
> |>       typedef XtPointer (*XmResourceBaseProc)();
> |>       -------------------^

-- 
David B. Lewis  			Lewis, Trachtenberg & Associates (LTA)
david@lta.com				+1 617 225 0366

Some financial models, on the other hand, yield a positive societal value for a
pack of cigarettes: smokers ... inflate group life-insurance premiums, but they
tend to die before costing society much in pensions or nursing-home care. - SA

mueller@daisy.cis.ohio-state.edu (klaus d mueller) (06/12/91)

Someone knows ?? 

I'm having problems with my swap space being too small. So I thought about
creating a big file and using SWAPON <file name> to add this file to my swap 
space. Will this create a problem when the file is not written in contiguous 
blocks ?

OR

Is there a way to divide an existing partition into two pieces without 
having to re-format the entire hard disk ?

I have a DECStation 3100 running ULTRIX version 3. Thank's for your help.

           Cheers  Klaus@lvd1.bme.ohio-state.edu