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

1 Answer 1

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:

2
  • 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? Commented Mar 31, 2017 at 1: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 Commented Mar 31, 2017 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.