Compile and link a motif program on VMS

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

6 posts / 0 new
Last post
Compile and link a motif program on VMS

Submitted by Anonymous on Sun, 01/21/2001 - 12:01. Developers
Hi,
How to compile and link a motif program on VMS operating system.
regards,
UPS

Anonymous

Off the top of my head (my VMS box has been on the blink for as long as I`ve had it)

1. Define the X11 logical, so your #include will work.
2. Link against the DECwindows Motif library, this involves a /OPT qualifier.

Have a look in the decw$examples directory; the example programs (dogs, DECburger, etc.) all have instructions.

Anonymous

Note, not decw directory, but decw-dollar-examples (something`s [mail?] gobbled up the `$examples` bit).

Anonymous

Dear friend,
would you please explain a bit. Assume that i have a motif program called hello.c. I am very clear about declaring logicals, please try to explain (i am a newbie to VMS and motif).
thanks

Anonymous

Like I said, I haven`t got access to a VMS box, so this is all from memory

1. Have a look at the DECwindows example programs

$ dir decw$examples*dogs*.*
$ dir decw$examples*burger*.*

There might be some .com files that show how to compile and link. Alternatively, the .c files might have the necessary expanatory comments in them.

2. Find the header files

$ dir sys$system[000000...]xlib.h
$ dir sys$libraryxlib.h
$ dir sys$library*decw*.*

Define X11 to be the directory that has the X/Motif .h files you want. You might have to do the same with an Xm logical, or you might be able to use the /include qualifier on the command line, or you might be able to define decc$include to look in the appropriate directories. There might be a decw$include logical that points to the right place.

e.g.

$ define x11 decw$include
$ define xm decw$include
$ cc hello

3. Find the libraries, and create a .opt file to pull in the X/DECwindows shared images

$ dir sys$share*decw*.*
$ create hello.opt
sys$sharedecw$xlibshr/share
! you might need something like sys$sharedecw$xmshr/share as well
[*Ctrl/Z*]
$ link hello,hello/opt

4. Also have a look on the OpenVMS Bookreader, there`s shedloads of documentation there. If the DECwindows/X stuff isn`t under `Programming Tools and Languages`, you might find it under `Office Applications` (weird place for it...).

I hope this helps,
Dave.

Anonymous

Hi Dave,
Tahnks a lot for your help. We were able to compile, link and run a motif program on VMS. The stes followed by us are as follows.

1) Compile source program (say hello.c)
cc hello.c

2) Create a file to be used for linking (say hello.opt)
The contents of hello.opt are

sys$common[syslib]decw$xmlibshr12/share
sys$common[syslib]decw$xtlibshrr5/share

3) Create executable by linking the /opt file

link hello,hello/opt

4) run hello

Success!!!!!!!!!

thanks and regards,
Upadhyaya