6

I used the IDE DEV C++ to compile C programs on Windows and I used the libraries and , but now I use Ubuntu and downloaded the Codeblocks, but it does not have these libraries. I just wanted to use some function similar to getch(), which is present in the library conio. Is there any similar library? And if there is how do I install?

Tachyons
  • 17,455
Patterson
  • 1,370

4 Answers4

5

It looks like you need to use the curses.h file instead. See here : https://stackoverflow.com/questions/8792317/why-cant-i-find-conio-h-on-linux

1

the best way, is create a symlink between curses.h and conio.h like:

ln -s /usr/include/curses.h /usr/include/conio.h

then you can use

#include <curses.h>
or 
#include <conio.h>

if you don't have curses.h

# debian/ubuntu
$ sudo apt-get install libncurses5-dev libncursesw5-dev
# voidlinux
$ xbps-install -S ncurses-devel
# archlinux
$ pacman -Sy ncurses
# redhate/fedora/suse...
$ sudo yum install ncurses-devel
nextloop
  • 153
1

You may look at https://github.com/pushkar6723/conio4gcc

Note that this is only compatible file. I recommend to shift on curses.h file, which has lot many things, which are absent in conio.h file.

0

Here is a possible solution:

  1. From https://sourceforge.net/projects/hlanguage/files/Source/include/conio.h/download download the 1.1 KB conio.h file
  2. Save or copy the file to the directory /usr/include
  3. Then from https://sourceforge.net/projects/hlanguage/files/Source/include/_mingw.h/download download the 3.8KB _mingw.h file which conio.h depends on.
  4. Save the _mingw.h file to the same location as the conio.h file.

Do not dump these files to your present project directory, they will not work. Besides these are general compiler libraries that you may need to compile other projects, so better to make them available to the compiler and not the project.

I am using an Android handheld, if you are on PC please revise this response with wget and precise download links.

muru
  • 207,228
Phume
  • 3