0

I run code that uses ncurses's get_wch. My code included curses.h version 6.4 patch 20221231.

Recently, on a new Debian installation, I installed the latest available version of ncurses. The new installation uses curses.h version 6.4 patch 20230729. My code does not run on this version and complains that get_wch is not defined.

In curses.h patch 20221231, line 1848 has: #define get_wch(c) wget_wch(stdscr,(c)). As far as I can tell there is nowhere in the latest version of the ncurses suite where get_wch is defined. Certainly, in curses.h patch 20230729 there is no such definition. I tried replacing curses.h patch 20230729 with patch 20221231 and the code runs.

I do not want to leave my code using this arrangement because curses.h patch 20221231 is quite different from patch 20230729 -- less lines, for a start.

If I am to use curses.h patch 20230729, how am I to define get_wch(c)?

rochfort
  • 31
  • 4
  • 1
    Does this answer your question? [ncurses get\_wch() function undeclared](https://stackoverflow.com/questions/66103288/ncurses-get-wch-function-undeclared) – Some programmer dude Aug 04 '23 at 08:33
  • OP didn't provide enough information to tell if it is a compile- or link-error (and the comment about replacing the header file doesn't help, since it would be irrelevant). – Thomas Dickey Aug 04 '23 at 18:56
  • @Someprogrammerdude Thank you for your comment. I think the problen you refer to is different. I get the following build message: error: 'get_wch' was not declared in this scope; did you mean 'getwc'? The line of code reads: int ret = get_wch(&ch); I think the cause is that get_wch is no longer declared anywhere. As I said earlier, get_wch used to be defined in curses.h. – rochfort Aug 06 '23 at 09:53
  • While the error message is not exactly the same, it's very likely the same problem. And then the solution in the accepted answer should hold true for solving your problem as well. Why not simply try it? – Some programmer dude Aug 06 '23 at 09:59

0 Answers0