Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a project related to mouse programming. I am having a problem that graphics.h, conio.h and dos.h not working in gcc. I tried

When I entered

sudo apt-get install build-essential

I got:

Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
build-essential set to manually installed.

The following packages were automatically installed and are no longer required:
calligra-l10n-engb cdparanoia k3b k3b-data k3b-i18n kdevelop-l10n
  kdevelop-php-docs-l10n kdevelop-php-l10n language-pack-kde-en libflac++6
  libk3b6 libkcddb4

Use 'apt-get autoremove' to remove them.

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Then I tried

sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev libsdl1.2debian-all libart-2.0-dev libaudiofile-dev libesd0-dev libdirectfb-dev libdirectfb-extra libfreetype6-dev libxext-dev x11proto-xext-dev libfreetype6 libaa1 libaa1-dev libslang2-dev libasound2 libasound2-dev

and I got the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done

Package libsdl1.2debian-all is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or is only available from another source

However the following packages replace it:


E: Package 'libsdl1.2debian-all' has no installation candidate

Please help me in using graphics.h, conio.h and dos.h in gcc.

share|improve this question
possible duplicate of Why can't I use conio.h or ncurses.h? – Eliah Kagan Apr 18 '15 at 1:04

As far as I know, graphics.h is an old obsolete Borland C++ header file for graphics in Ms DOS OS. I think the last Borland C++Builder no longer supported graphics.h. However graphics.h has been simulated for Windows. Executables made using graphics.h usually don't work in newer PCs (and laptops with Windows OS).

(Although graphics.h has simple to use graphical functions, using it is no longer recommended/supported)

Also open source C++ compilers usually do not support conio.h.

conio.h has most functionality in Borland compilers. It's also supported in MS VC++, but with less functionality. conio.h is not supported in gcc, etc.

share|improve this answer
So is there any other alternative? – REGZEN Apr 5 '13 at 17:18
@REGZEN: Yes there are alternatives. ncurses is a package which provides functions you need. Also if you don't like to use it getch and kbhit can be written using other functions if you need them. yes for sure. – user126106 Sep 11 '13 at 16:53

Embarcadero/Borland has Turbo C version 2 available for download on their website. Since it is a old compiler that runs under DOS you will need to install dosbox in order to use it.

You may wish to start using a modern graphics library such as SDL which will allow you to do graphics/mouse input in Ubuntu.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.