Sem 4‎ > ‎CG LAB‎ > ‎

0 Getting Started

posted Dec 18, 2011, 2:27 AM by Neil Mathew   [ updated Jan 14, 2012, 8:47 AM ]
I installed Windows XP SP3 on my desktop so that I can run Turbo C 3.0. 

However, I keep getting this strange error:


Wasted too much time thinking my setup file was corrupt. 

SOLVED: Using DOS BOX, Everything works. Strange but it works.

(Other Reasons for using DOSBOX: Screenshots possible when not allowed in XP)

Step 0: Install Turbo C normally into,say, C:/

Step 1: Install DOSBOX

Step 2: To make DOSBOX directly lead to TurboC:


Go to DOSBox Options.


It will open a notepad. Scroll to the very bottom.


Type:

mount c: <drive destination to shorten>
c:/
cd TC
cd BIN
TC

ALL DONE!


Step 3: To enable graphics in Turbo C:

Allowing Graphics Libraries. Just Look at the images.



       

         



DOS BOX SHORTCUTS


Alt+Enter : Switch between full screen and windowed modes.

Ctrl+F9 : Kill dosbox. 

Ctrl+F1 : Start the keymapper.

(Remove a command like Ctrl F9 using above)

Ctrl+F5 : Save a screenshot in the Capture subfolder (as a PNG).

Ctrl+F10 : Capture/Release the mouse.




So, moved on to a viable alternative:

DEV C++

I've used this once before. 
It is a fully featured graphical IDE using the MinGW compiler system. 

MinGW (Minimalist GNU* for Windows) 
uses GCC (the GNU g++ compiler collection), which is essentially the
same compiler system that is in Cygwin (the unix environment program for Windows)
and most versions of Linux. 



Now, there's still something more we have to do:

Unfortunately, graphics.h is a Borland specific library and cannot be used with Dev-C++.  

Fortunately, Michael Main has modified a BGI emulation library for Windows applications 
to be used under MinGW (and therefore Dev-C++) which he has aptly named WinBGIm.

Therefore, a few extra steps need to be followed to use graphics in Dev C++:

Step 0: Download & Install Dev C++ from here.
                                    (The setup which includes full Mingw compiler system)

Step 1: Download & Install WinBGIm from here.
                                    (Open with DevC++ 's Package Manager aka Packman.exe)



Step 2: Make a new Console Application Project.

Step 3: Configuration:

Go to “Project” menu and choose “Project Options”.

Go to the “Parameters” tab.

In the “Linker” field, enter the following text:

-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32

Click “Ok” to save settings.






EXAMPLE PROGRAMS:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
  #include <conio.h>
  #include <iostream>
  #include <string>   
  
  using namespace std;   // This is necessary for string headerfile
 
  int main()
  {
      string s;
      s = "This is a test";
      cout << s << endl;
      getch();
      return 0;
  }

1
2
3
4
5
6
7
8
9
  #include <conio.h>
  #include <iostream.h>  //can be used without namespace line
 
  int main()
  {
      cout << "This is a test" << endl;
      getch();
      return 0;
  }

And just as you see <conio.h>, <graphics.h> should be used too.




SOLUTION
TO ALL OUR PROBLEMS

I have a single exe setup file which is Turbo C integrated with DOSBOX.

However, it's combined so beautifully that
  • CTRL+F9 works as it would in Turbo C, without exiting as it would do in DOSBOX. 

  • PrintScreen works as it would do in DOSBOX, unlike in solo Turbo C.

I've attached it to this page. Hats Off to it's creator.

ċ
TurboC++forWindows3.0.7.8beta.zip
(4541k)
Neil Mathew,
Jan 14, 2012, 9:02 AM