Turboo C++

Turboo C++ on Ubuntu using Dosbox
Turboo C++ on Ubuntu using Dosbox2
Turboo C++ on Ubuntu using Dosbox2

The objective of this article is to help students to run Turbo c++ under Ubuntu (Linux) O/S.  
Turbo c++ is a very widely used compiler for C and C++ in most Indian schools and colleges. Though there are many other compilers like Eclipse CPP (not to be confused for Eclipse IDE for Java), CINT etc.. available for free and offer better useful and interesting IDE features, many schools and colleges are still using Turbo c++ which is an outdated compiler. As students are never exposed to such new technology updates, they are not confident in using latest C++ compilers.The reason why Turbo C++ cannot run under Ubuntu is  because turbo C++ is built for DOS. But there is a way of doing it. The solution to this problem is using Dosbox, which is a DOS emulator for Linux O/S. Dosbox has a repution of being very light and stable emulator for DOS based programs and was developed with the intension of using it to emulate DOS games and programs on linux systems.You may be wondering why I chose Dosbox instead of WINE, well thats because wine cannot handle dos programs like Turbo C++, and in my experience wine is  heavy on the system as it is basically meant for Windows based programs.
Steps to get it goingStep 1) INSTALLATION Run this command in terminal(Ctrl+Alt+T): 
code :- :- $ password code :-:-  $ sudo -su
Once your done installing Dosbox you will now need the turbo C++ installation file which can be downloaded from here(download).
Unzip the turbo C++ zip folder and place the files in home/your-user-name directory under a folder called setup.
Now open up Dosbox and Type in the below code (in separate lines):
Code :- mount c ~ (press enter)
c: (press enter):- cd  (Extracted folder name) Ex.. turboc
 turbo C++ installation












This will start the setup of  Turbo C++. 
 Here choose the destination drive as c and source path as setup in the next window.

 turbo C++ installation Step

 turbo C++ installation Step 3

 Select "Start Installation" in the below window.
Turbo C++ is now installed on Dosbox. You may consider checking it by executing the following code on Dosbox (in separate lines): 
code :- c: (press enter)
cd TC\bin (press enter)
tc.exe
 turbo C++ installation Step 4
Step 2) Creating the configuration file
 turbo C++ installation Step 5
 Run this command in DOSBOX to generate the configuration file which will be stored as: /home/user-name/dosbox.conf.  
Ensure you enter your system user-name in place of "your-username" in the below code:
code: - config -writeconf /home/your-username/dosbox.conf
Step 3) Creating auto-mount and emulating in fullscreen.
Creating auto-mount and emulating in fullscreen.
 Open dosbox.conf that we created earlier in any text editor, which you will find it under home/your-username, and configure DOSBOX for auto-mount
dosbox file
 Add the following lines at the end of the configuration file as shown in the above highlight.
Code :-  
 mount c ~ /home/your-username/
c:
cd tc
cd bin
Now to set the default screen size to full-screen, find the word fullscreen in the same file (dosbox.conf)  and change its value to true:
Fullscreen
 Now you are done setting up the configuration file for Dosbox to auto-mount and emulate in fullscreen. Save the file and close it.
Step 4)  Deleting Ctrl+F9 key to avoid shutdown of Dosbox
And in the end you will have to delete a key from the Dosbox keymapper : Ctrl+F9
Since Ctrl+F9 is a Shutdown key in Dosbox you may feel very irritated with it, as the same key is used to compile a program in Turbo C++.
To work-around this issue, open dosbox and hold Ctrl+F1. Now in the window, select theshutdown option on the right hand side bottom, click on delete and then save and exit. This should remove the keymap to Shutdown DOSBOX.
Deleting Ctrl+F9 key to avoid shutdown of Dosbox

Step 5) Creating Launcher
To make things more convenient, we will create a launcher so that you can run your compiler just by double clicking on it. Here's how you can do it: 
Right click on the desktop and select create launcher.
Name: Turbo c++
command: dosbox -c TC.EXE -c EXIT
Update: For creating launchers on Ubuntu 11.10 follow this post 
for creating launchers on Ubuntu 11.10 follow this post
and now its all set for you to enjoy Turbo C++ on Ubuntu.
Note: Since we have set Dosbox to open in fullscreen you may consider the Alt+Enter key to use it under seamless mode  .
If you have any trouble on the installation procedures contact me on www.facebook.com/solveubuntu

No comments:

Post a Comment