Saturday, March 31, 2007

TurboC++ on Linux

Ever tried running TurboC++ on Linux? Hate CBSE for still using such a sucky compiler even though it has gone out of use after 13 years? DosEMU giving nightmares and not working right? DosBOX has come to your rescue.

Seriously, after trying years to make TurboC++ work on DosEMU using various configurations, I finally gave up and tried to use DosBox, something that was originally meant for playing DOS games, but works like a charm for TurboC++.

Anyway, to get TurboC++ working on Linux:

  1. Get Linux: Like, DUH!
  2. Get TurboC++: Get it here
  3. Get DosBOX: Get it here. I've also compiled RPMs for DosBOX on FC5:
    1. SRPM
    2. RPM
    3. debuginfo RPM
  4. Install DosBOX See DosBox documentation on its site
  5. Integrate TurboC++ with DosBOX:
    1. Unzip the TurboC++ zipfile into ~/tc. It will create a directory called tc inside ~/tc. Rename this directory to something like INSTALL or something.
    2. Run DosBOX and the enter the following code:
      mount c ~/tc
      c:
      cd install
      install
      It will show an installation screen. In the first screen, ensure that the source media is C, not A. On the other screen, The Default Works Just Fine™.
    3. When the installation is done, issue the following commands:
      cd \tc\bin
      tc
      This will launch TurboC++. Go to Options->Directories. In Includes, put ";C:\TC\CLASSLIB\INCLUDE" ath the end (without the quotes). In Libraries, put ";C:\TC\CLASSLIB\LIB" at the end (without the quotes). This isn't required, but this allows you to use the predefined classes, like vectors, queues, stacks, lists, string etc., offered by C++. Exit TurboC++
  6. (Optional) Make DosBOX autorun TurboC++:
    Open ~/.dosboxrc in your favourite editor and put the following in it:
    @echo off
    echo Setting default sound mixers
    SET BLASTER=A220 I7 D1 H5 T6
    SET ULTRASND=240,3,3,5,5
    SET ULTRADIR=C:\ULTRASND
    echo Mounting TurboC++ directory as C:
    mount c ~/dosbox
    echo Setting required environment variables
    set FILES=20
    c:
    set PATH=c:/tc/bin;c:/bin;z:/
    echo Running TurboC++
    tc
    @echo Exiting...
    exit

Now, everytime you run DosBOX, it will automatically open up TurboC++. You can create a shortcut or something on the desktop for running DosBOX. Though, as the great thinkers of the 21st century have said, Your Mileage May Vary™.

Saturday, March 03, 2007

Lunar Eclipse tonight

Tonight is the Lunar Eclipse. Here's a time table picked up directly from the US Navy Lunar Eclipse Computer (time has been offset to +0530GMT, ie. Indian Standard Time)):

                  Total Eclipse of the Moon

                            NEW DELHI
                            o  '    o  '
                         E077 12, N28 42

                 Zone:  5.50h East of Greenwich

                                                      Moon's
                                                Azimuth   Altitude
                                     h  m            o        o
Moonrise               2007 Mar 03  17:55          79.2     ----
Moon enters penumbra   2007 Mar 04  01:46.4       224.8     61.7
Moon enters umbra      2007 Mar 04  03:00.0       246.1     48.3
Moon enters totality   2007 Mar 04  04:13.8       258.7     33.0
Middle of eclipse      2007 Mar 04  04:50.9       263.6     25.0
Moon leaves totality   2007 Mar 04  05:28.0       268.0     17.0
Moon leaves umbra      2007 Mar 04  06:41.7       276.3      1.5
Moonset                2007 Mar 04  06:51         277.3     ----