Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getch + DEC C++ linking

6 views
Skip to first unread message

Marc Kessler

unread,
Jul 9, 1994, 4:45:34 PM7/9/94
to
I want to link some *.cxx code with a getch() call in it to the proper RTL, but
it seems no matter what qualifiers/libraries I put on the link command line I
get:
%LINK-I-UDFSYM, DECC$BSD_WGETCH

Can anyone help me link this program? I'm using VMS 5.5-2 with the CRT060
installed. Thanks,
Marc

Ken Cowan

unread,
Jul 11, 1994, 11:18:16 AM7/11/94
to

This is a bug in curses.h. Compile your program /DEFINE=__VMS_CURSES
and it should work.

I'll also mail you the new curses.h, if that'll help.

--
Ken Cowan, ZK2-3/Q8 co...@rtl.enet.dec.com
Digital Equipment Corporation decwrl!rtl!cowan
110 Spit Brook Rd,
Nashua, NH 03062

Andreas W. Wylach

unread,
Jul 12, 1994, 7:02:12 AM7/12/94
to
In <2vn29e$e...@bigblue.oit.unc.edu> kes...@halley.sph.unc.edu writes:

There is no function in the rtl called getch(). You can build your own:

int
getch()
{
unsigned long kbid; /* keyboard var */
unsigned short key; /* key var */

smg$read_keystroke(&kbid,&key);
return(key);
}

int
getint()
{
int c;

do {
c = getch();
} while (c == SS$_NORMAL);

return c;
}

You can put those two functions together, ofcourse. Before you use this
function with smg$read_keystroke, you have to initialize the
keyboard in a int function, or in some fuction, were you make your inits.
Just put in the line:

#include smgdef
.
.
.
main()
{
.
.
.
unsigned long kbid;
smg$create_virtual_keyboard(&kbid);
.
.
.
}

If you dont know the keys Names for smg, just read the smgdef.h in syslib.
There you can see all names of the dec keys...

Andreasw
a...@wnvax.wupper.de


--
Andreas W. Wylach -- a...@ifwb.wupper.de -- IfwB Wuppertal -- Germany
-- Informationsystem from students for students | WupperNet --
-- you don't vax me like you used to **BREAK** --

Ken Cowan

unread,
Jul 13, 1994, 9:28:09 AM7/13/94
to

I think I posted a response a couple of days ago. Maybe it got
lost.

The problem with the original poster was a bug in curses.h.
curses.h defines a macro getch that maps to wgetch(stdscr).
wgetch exists. The code to call SMG directly ought not be
necessary.

0 new messages