0

I recently downloaded ncurses from here and have compiled it using ./configure and make

As it is recommended in the README, I compiled the example programs that come bundled with the package. The programs compiled without any issue, but every time I run the programs I get the following errors:

Terminal type "xterm-256color" terminals database is inaccessible Changing the terminal's type using TERM=xterm and export TERM don't seem to solve this issue, and I'm just stuck. Will ncurses work if I included them in my C/C++ programs, or should I make sure the examples work?

Thanks in advance

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
Ricardo Iglesias
  • 595
  • 2
  • 6
  • 16

1 Answers1

1

Probably you did not install the terminal database, or did not tell the programs where to find it.

OSX comes with ncurses 5.7 (old, but not the problem here), with the terminal database in /usr/share/terminfo. However by default the configure script assumes you want to install in /usr/local. You can tell the programs where there's a terminal database by setting the TERMINFO environment variable, or (better), setting TERMINFO_DIRS to list both locations (with the newer one first of course).

For a start, something like

export TERMINFO=/usr/share/terminfo

should be enough to make the examples run.

Further reading:

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • This made the examples run. Thank you! I am a bit confused, though, do I need to do anything els to be able to use the ncurses libraries in C++ programs? – Ricardo Iglesias Mar 31 '17 at 01:04
  • Setting the environment variable only helps for the shell where you set that. I'd go ahead and install (into /usr/local, I assume) and set `TERMINFO_DIRS` to the two directories, e.g., /usr/local/share/terminfo:/usr/share/terminfo – Thomas Dickey Mar 31 '17 at 01:08