Conio.h is missing on Windows

I usually use VS, but first try to run cygwin. I use Windows 7, but when compiling the hello world program using gcc, it says "fatal error: conio.h: there is no such file or directory".

I am using Windows 7 and it seems that conio.h is missing on my system. Can someone please tell me how to solve this problem.

Thank!!

+4
source share
3 answers

There is no such header file named Cygwin conio.h! In addition, you do not need this, because it automatically holds the screen for you, not using getch(), but for clrscr()you have system("clear")in Cygwin!

+3

conio , , - .

, conio Borland, Microsoft API- - Microsoft . .

, conio Windows, Cygwin - API POSIX POSIX Windows. , , , Visual Studio.

, :

  • - , ​​ ncurses.
  • conio Linux, this ( ncurses Borland API).

, , , , conio, , , . getchar() , , .

Cygwin , GCC Windows, MinGW/GCC. Microsoft C, GNU, API Win32, POSIX.

+1

conio.h is a non-standard header provided by the Borland Turbo C compiler, corresponding to the C. Cygwin compiler itself, which is an emulation of windows of a unix-like environment, does not have it (indeed, I do not know of another compiler that providesconio.h).

Can someone please tell me how to resolve this issue.

The best way to resolve this is to not use it at all :)

Instead, you can use ncurses if you want something that provides similar functions and compile it with:

gcc test.c -lncurses 
0
source

All Articles