The objective of this article is to help you to run Turbo c++ under Ubuntu(Linux) Operating System.
Still in our schools and colleges, Turbo c or c++ is the most widely used compiler. Although there are so many other compilers also avaialble for free which are even better than this outdated compiler but still the students are not exposed to such new technologies.
Turbo c++ cannot run under Ubuntu as it is built for DOS. But it can be possible by using Dosbox, which is a DOS emulator for Linux Operating System. Dosbox is light and very stable emulator for DOS based programs and it was developed with the intension of using it to emulate DOS games and programs on Linux system.
No doubt, we use WINE to run the windows based programs on Ubuntu or Linux kind of O/S but here in this case, WINE can’t be used so efficiently as it can’t handle the DOS programs like Turbo c++, moreover wine is heavy on the system as it is basically meant for Windows based programs.
STEPS TO FOLLOW:
Open the terminal by CTRL+ALT+T.
Type the following code:
sudo apt-get install dosbox
Once it has been installed, download the Turbo c++. Extract this. And simply place the folder in /home directory. Now, open dosbox by simply typing
Here, we have to mount the Turbo, type the following commands for this task-
mount c ~
Now, press Ok to start the installation. Select C: drive for destination and source path as setup in the next window.
Select Start installation. After it is done. Write the following code:
2. CREATING CONFIGURATION FILES:
Run the following code:
config -writeconf /home/your-username/dosbox.conf
3. CREATING AUTO-MOUNT AND EMULATING IN FULLSCREEN
Open dosbox.conf file which we have created earlier under /home directory.
Now, to set the fullscreen mode, find the word fullscreen in the same file and change its value to true.
Save and close this.
4. DELETING Ctrl+F9 KEY TO AVOID SHUTDOWN of DOSBOX
In the end, you’ll have to delete a key from the dosbox keymapper : ctrl+F9
Since Ctrl+F9 is a Shutdown key in DOSBOX, so it can create problem while compiling a c++ program, as the same key is used to compile in Turbo c++.
To solve this, open the dosbox and hold ctrl+F1. Now, in the window, select the shutdown option on the right hand side bottom, click on delete and then save and exit.
That’s all about it. Now, you’re able to run c++ program using Turbo c++ in Ubuntu.