Sunday, September 5, 2010

How to Install/Run Turbo C/C++ IDE on Linux

Borland Turbo C/C++ IDE is not the best, not at all recommended on production floor. But it's still the mainstay in majority of schools and colleges, especially in India. GCC/G++ on linux is better for hardcore programming. However, from a beginner's perspective, it lacks those nice contextual buttons/menus and interface of Borland Turbo C/C++ IDE.

Thanks Dosbox! You can install/run Turbo C/C++ IDE on linux too. Just follow these steps.

#1 Install Dosbox

Installing dosbox is a child's play.
If you are running Debian or Ubuntu, open the terminal as a root user and enter:
apt-get install dosbox

If you are running Red Hat, Centos or Fedora, open the terminal as root user and enter:
yum install dosbox

#2 Download Turbo C/C++ IDE

Google a bit, and you will easily find Turbo C installers for Windows/DOS in a zipped archive format.

#3 Extract Turbo C/C++ Archive in your home (~) directory

#4 Run (Alt+F2) Dosbox or open dosbox from programs menu (it sits generally under Applications > Games)

#5 Mount your home (~) in root



Inside dosbox type:
mount c ~


#6 Move to the extracted "Turbo C" directory



Type:
c:
cd TURBOC~2



then:
install

It will start the setup. Follow the ncursed instructions to install as shown in the screenshots below.



Just press Enter to continue installation.



Enter C in the "Enter the source drive to use:" option.



Accept defaults and Press F9.



Press any key to continue with the installation





Turbo C/C++ IDE Installation is complete

#7 Running Turbo C/C++ on Linux

Run/open dosbox. Enter the following one by one in the dosbox terminal



mount c ~
c:
cd tc\bin
tc.exe



Turbo C is running on Linux

7 comments:

Jan Kjetil said...

You would think that no one would actually use something like this today, but I had a small customer project 2 years ago where the easiest and quickest solution turned out to be EXACTLY this configuration - DosBox + Borland C++.. :-) One of our customers here in Norway insisted on keeping their old DOS-based PDAs and instead of using the dreadful framework that came with the terminal I programmed a solution from scratch using the original libraries. I even tested it under DosBox using a simple (self-hacked) API emulation layer that handled screen updates. Funny little project that turned out to be just what the customer needed!

manmath sahu said...

Jan, thanks for dropping by. Your experience with DosBox+Borland Compilers is very interesting.

Anonymous said...

I have replaced turboc with CodeBlocks. It works for both ANSI C as well as C++ subjects taught in colleges. Better compliance of C / C++ than TurbC.

Ranjith said...

How can we run Turbo C/C++ using DosBox from Lucid Puppy Live CD (lupu_525)? Can we preinstall DosBox and Turbo C/C++ to lupu_525 iso. Is there any portable linux DosBox available that we can run from USB?

manmath sahu said...

Not much idea about Puppy. But I hope puppy must have dosbox package. If so, the rest of the process is the same.

TE])])Y said...

thanx!!...it helped me a lot!!

Madhan said...

A very helpful post. I have used this method on a Win7 64 bit PC too, which otherwise didn't let me execute TC.EXE. Even the BGI graphics work! Another small hint. Most of us are used to pressing Ctrl+F9 in TC for executing the programs. It seems Ctrl+F9 is the default shortcut key to shutdown DosBox. To avoid this, we can press Ctrl+F1 in the DosBox window. It opens the key map dialog. Click the "Shutdown" button, the "Del" button and then the "Save" button. Then we can return to TC and use Ctrl+F9.
Thanks to
http://www.youtube.com/watch?v=Y-0G28zNgbA

Share your thoughts