Message Board -  Archive

[ Login ] [ Create Account ]
[ Board List ] [ View Board ] [ Post Reply ]
  Author  Subject: Linux C libary, using getch() in curses.h
Archive  

Posted on 12-03-2001 02:16 p.m. ET  reply

Original Poster: Andrew Finger

I'm trying to access the keyboard without printing to the screen. Jamsa's
C/C++ Bible uses the conio.h file to use getch; however, I am using a Linux
OS. I found the curses.h and ncurses.h files to have the same getch()
function, but when I run my test.c program, I get errors. From exploring a
little, I manage to find information regarding the error, but I have no idea
what any of it means. Here's what I've found:

test.c
CODE: char c = getch();
ERROR: undefined reference to `stdscr'
ERROR: undefined reference to `wgetch'

ncurses.h
CODE: extern NCURSES_EXPORT(int) wgetch (WINDOW *);
CODE: extern NCURSES_EXPORT_VAR(WINDOW *) stdscr;
CODE: #define getch(void) wgetch(stdscr)

ncurses_dll.h
CODE: #define NCURSES_IMPEXP __declspec(dllexport)
CODE: #define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
CODE: #define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type

All I get is that there are external objects called wgetch and stdscr which
somehow deal with the defined NCURSES_IMP_EXP definition. I've no idea
what's going on beyond that.

If possible, could a response be sent to wackyfuitoo@hotmail.com?

< Previous 1 Next >

Site Contents