Thursday, May 21, 2015

Install Turbo C, C++ in Ubuntu


Steps for installation....

Step 1) INSTALLATION

Download DOSBox Emulator from USC [Ubuntu Software Center].


download dosbox from ubuntu software centre

                                                OR

Run this command in terminal(Ctrl+Alt+T): 

code:


 
sudo apt-get install dosbox

When your done installing Dosbox you will now require the turbo C++ installation setup which could be downloaded from here(download).

Unzip the setup zip folder and place the files in home/your-user-name directory (* Necessary)

Now open up Dosbox and Type in the below code (in separate lines):


Code:

mount c ~
c:
cd setup
install.exe 


mount dosbox to run turbo c

     This will start the setup of  Turbo C++.


turbo c installation setup

     Here choose the destination drive as c and source path as setup in the next window.



source drive to use turbo c




   Select "Start Installation" in the below window.



start installation

Turbo C++ is now installed on Dosbox. 
To run the Turbo C++ every time run the following commands:


Code:
c:

cd TC\bin

tc.exe 



To enter into fullscreen mode press  Alt+Enter and press it again for window mode.

Step 2) Creating the configuration file

creating configuration file
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.

auto mount in full screen
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.
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
TC
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:
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 the shutdown option on the right hand side bottom, click on delete and then save and exit. This should remove the keymap to Shutdown DOSBOX.
dosbox key mapping

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
If there is no option for create launcher:
gnome-desktop-item-edit --create-new ~/Desktop
This will launch the old GUI Dialog and create a launcher on your Desktop:
enter image description here
Prerequisites
gnome-desktop-item-edit is installed automatically if you have installed gnome-shell/gnome-fallback. It is also installed automatically if you have previously installed gnome-tweak-tool.
Alternatively, you can install the old gnome-panel without much of the bulk:
sudo apt-get install --no-install-recommends gnome-panel
Reference Link:

No comments:

Post a Comment