13

I am totally new to C++ programming on gcc. I wanted to add color to my text on the output on the console. Since there is no conio.h on linux, I researched and found that ncurses.h could do the trick. Now the only problem is that I do not know how to download it and then add the library. Can someone please describe the method?

Also, if anybody can describe whether ncurses.h is a better option than curses.h or if I am completely wrong in using curses.h?

Lucio
  • 18,648
  • 31
  • 107
  • 190
prometheuspk
  • 482
  • 3
  • 8
  • 17

1 Answers1

15

on ubuntu:

install ncurses library (packages for developers has "-dev" postfix)

sudo apt-get install libncurses5-dev

for each package, in /usr/share/doc/{package name}/ you can find documentation.

Open this URL file:///usr/share/doc/libncurses5-dev/html/index.html in your browser.

Have fun.

Michał Šrajer
  • 27,439
  • 4
  • 33
  • 29
  • In the unlikely event that the documentation for `ncurses` doesn't prove sufficiently helpful, you can always pick up a copy of Dan Gookin's _[Programmer's Guide to nCurses](https://www.amazon.com/Programmers-Guide-NCurses-Dan-Gookin/dp/0470107596)_ – Agi Hammerthief Dec 19 '18 at 09:55