Not able to use #include<conio.h> header

If you face any compile time issues while writing/compiling the C program, create a topic under this forum.
Post Reply
sandhya
Posts: 2
Joined: Thu Jun 03, 2021 3:20 pm

Not able to use #include<conio.h> header

Post by sandhya »

Hi All,

I am not able to use the header #include<conio.h>. Getting the issue: fatal error conio.h: No such file or directory.
I am using Geany editor. GCC version is : 7.4.0
admin
Site Admin
Posts: 5
Joined: Thu Jun 03, 2021 1:32 pm

Re: Not able to use #include<conio.h> header

Post by admin »

Hi Sandhya,

conio.h header file which is mostly used by MS-DOS compilers like Turbo C.
It is not part of the C standard library or ISO C, nor is it defined by POSIX. That is why whenever you are using the latest
GCC version, you might face issue with #inlude<conio.h>.

One more post regarding this header:
We should not use this header, because it is a header used in ancient, outdated compilers like Turbo C and it is not either part of the standard C library.

Still if you want to use #include<conio.h> then you try to use older version of GCC compiler. I did this way.
1: Install Geany software(This is an IDE)
2: Install the software: TDM GCC compiler (Do not install the latest version. Instead get it from : https://sourceforge.net/projects/tdm-gcc/) Its version is 5.1.0
sandhya
Posts: 2
Joined: Thu Jun 03, 2021 3:20 pm

Re: Not able to use #include<conio.h> header

Post by sandhya »

Thanks for the reply. But still I am facing the issue. I have uninstalled the Geany, TDM GCC compiler from control panel ->Uninstall a program. After this once I check the command prompt for the gcc verion, it shows 7.4.0.
I have checked, is there any other C compiler installed or not. But there is no other c compiler.
admin
Site Admin
Posts: 5
Joined: Thu Jun 03, 2021 1:32 pm

Re: Not able to use #include<conio.h> header

Post by admin »

Thats strange. What I can suggest is, you might have software/s, that is dependent on C compiler. So, might be that software has installed c compiler along with that software. So, its better to not to delete any other c compiler that you are not aware of. Anyhow yo are not suppose to use the header <conio.h>
Still if you wanted to use this header, try using online c compiler. google it.
Post Reply