Results 1 to 3 of 3

Thread: How to add the ncurses.h to a C++ program compiled on gcc

  1. #1
    Join Date
    Jan 2011
    Location
    Karachi, Pakistan
    Beans
    22
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Cool How to add the ncurses.h to a C++ program compiled on gcc

    I am totally new to C++ programming on gcc. I wanted to add color to my text on the output to 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?

  2. #2
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: How to add the ncurses.h to a C++ program compiled on gcc

    If all you want is colored output, you don't need curses, just use the ANSI color codes.

    http://en.wikipedia.org/wiki/ANSI_escape_code#Colors

  3. #3
    Join Date
    Mar 2010
    Location
    Norway
    Beans
    674

    Re: How to add the ncurses.h to a C++ program compiled on gcc

    Quote Originally Posted by padfootpak View Post

    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?
    I am of the understanding that curses.h and ncurses.h on most GNU/Linuxt systems are the same files, curses.h added for compability with older programs:
    Code:
    $ diff /usr/include/ncurses.h /usr/include/curses.h 
    $
    Correct me if I'm wrong.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •