0

I want to use Unicode characters as the border for my custom window.

After searched about it, I found the document about border_set that use const cchar_t* instead of chtype.

But my compiler say identifier undefined while other ncurses functions work well. How can I use border_set?

identifier "wborder_set" is not defined

  • Possible duplicate: [ncursesw functions not declared](https://stackoverflow.com/q/59971200/12122460). Try defining `NCURSES_WIDECHAR` before including the headers. – kotatsuyaki May 31 '22 at 10:19
  • As your link, I add -I/usr/include/ncursesw to makefile then still error in vscode but successfully compiled and run in exactly what I wanted way. What is NCURSES_WIDECHAR and how do I define it? Sorry if this sounds like a stupid question but I literally don't know anything. @kotatsuyaki – Ma Joonyoung May 31 '22 at 12:16
  • Both the compiler and the linker can complain about missing identifier. Since the question description does not include the full compiler error message, I was not able to tell whether the error comes from the compiler (which leads to the `NCURSES_WIDECHAR` solution) or the linker (which leads to the `-lncursesw` solution). Try to follow [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) next time, and be sure to include the full error message. – kotatsuyaki May 31 '22 at 12:41
  • 1
    FYI, the wide character support part in `curses.h` is enabled only if the macro `NCURSES_WIDECHAR` is defined to `1`. In most cases the header automatically do this for you (which is your case here), but if it does not then a `#define NCURSES_WIDECHAR 1` may be needed. See [documentation of ncurses](https://invisible-island.net/ncurses/man/ncurses.3x.html#h2-ALTERNATE-CONFIGURATIONS). – kotatsuyaki May 31 '22 at 12:43
  • So, in my case, header automatically defined NCURSES_WIDECHAR as 1 to enable to use wide char, so that the only thing I should do was edit makefile. Thanks for sharing your knowledge. I sincerely appreciate your comment and sorry for the confusion by not attaching the information of error. @kotatsuyaki – Ma Joonyoung May 31 '22 at 13:04
  • This answers your question: [ncursesw functions not declared](https://stackoverflow.com/questions/59971200/ncursesw-functions-not-declared) – Thomas Dickey Jun 02 '22 at 07:44

0 Answers0