Why can't I use conio.h or ncurses.h?
I am new user to Ubuntu. I wrote a simple program in C. When I try to compile it to use conio.h, the compiler gives me fatal error. So I tried by ncurses.h, but still I am getting same error.
1 Answer
Why conio.h Isn't Available
g_p mostly answered this in a comment:
conio.his not present in Linux. You need to usecursesorncurses. But if you are getting error likefatal error: curses.h: No such file or directory', it means this library is not installed.
For more information on conio.h (and how it's DOS/Windows specific), see the Wikipedia article on it.
Why ncurses.h Wasn't Available, and How To Fix It
As for ncurses, it's necessary to install the libncurses5-dev (or libncursesw5-dev
) package, and then pass the
-lncurses argument to gcc when compiling, for example:
gcc -Wall -g -o hello hello.c -lncursesSee How do I create simplistic window-like elements in a command-line program? (and its sources) for more information.
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"