king1@husc10.harvard.edu (Gary King) (05/04/91)
I'm writing a c++ program that does screen manipulation and
am unable to tie curses in with it. I compile using:
g++ -o name prog.c -lcurses -ltermlib
and the linker complains about _unctrl being undefined. _unctrl
is declared in /usr/include/curses.h (used to be in /usr/include/unctrl.h)
as an external variable but I would think that it would be defined
somewhere.
I also wrote a little program with a declared (but *undefined*)
external variable and both cc and g++ didn't mind that at all:
#include <stdio.h>
/*
* Used to be in unctrl.h.
*/
#define unctrl(c) _unctrl[(c) & 0177]
extern char *_unctrl[];
extern char _c[];
main() {
printf( "Now is the time\n" );
}
It compiles, links and runs just fine....
So, does anyone out here in C++-guru-land have any suggestions. If
I get a lot of responses and they are non-trivial, I'll post a
summary. Sorry if this is an FAQ... but help!
Gary