Curses question

0257014-Robert White140 rwhite at nusdecs.uucp
Thu Nov 22 06:03:02 AEST 1990


In article <hart.659105063 at blackjack> hart at blackjack.dt.navy.mil (Michael Hart) writes:
>I've been trying out curses on an SGI Personal Iris.  The problem
>	Compile:		cc cur1.c -lc_s -lcurses -o cur1

	While I don't beleive that it is a problem in your current
example, you should remember that the libraries are scanned in the
order they occur on the cc command line (in ?most? implementations) so
if you use the shared c library (-lc_s) is *MUST* be the last library
spesified!  If you don't do this you may discover many strange things
happening durring compilation or runtime (depending on numerous
things).

(e.g.) if your program calls a routine x and curses calls a routine y
and x and y are from the standard c library and both depend on the
same global data item you will have name colision because the y will
come from the c library and x will come from the shared library and
the data item will be included twice by the same name with an
impossible linkage [sic]

	These linkage problems *may* already be occuring in your
example because of the possiblity thay you may be getting stdio
routines piecemeal from the tro libraries.  Don't *know* this to be
the case, but it could happen.

> [Some Code]

	It *looked* ok at a quick read.  The only thing that really
jumped out at me was that if you use the strange-key definitions you
really *should* call keypad(win,TRUE) on the window you wgetch() your
input from (stdscr in the example).

	An other possibility is that the control-C combo may be setup
to signal(2) your program.  If you have ^C setup as interrupt or quit
your system would abort the program instead of using your branching
logic to exit.  This could cause the symptoms you describe.  The best
way to test this is to check for a known-not-to-be-special character
like the space bar; or put some indicative code after the loop (e.g. a
printf("Normal Exit\n"); after the endwin() call.

Disclaimer:  Just a few guesses that might help, not dogma (woff ;-)

*******************************************************************
Robert White           |   Not some church, and not the state,
Network Administrator  |      Not some dark capricious fate.
National University    |   Who you are, and when you lose,
crash!nusdecs!rwhite   |      Comes only from the things you chose.
(619) 563-7140 (voice) |                             -- me.
*******************************************************************



More information about the Comp.lang.c mailing list