150 likes | 323 Views
How to Use The Borland C++ Compiler Version 5.02 to create C++ and C programs annedawson.com. Start up the Borland software. Double click on the Borland C++ icon on the desktop:
E N D
How to UseThe Borland C++ CompilerVersion 5.02to create C++ and C programsannedawson.com
Start up the Borland software • Double click on the Borland C++ icon on the desktop: • If the icon is not on the desktop, click on the Start button and select Programs from the list of options. From the programs list, click on Borland C++ 5.02 then Borland C++.
You should then see the following screen. Don’t worry if the screen is not exactly like yours – but it should have the Borland C++ icon and title in the top left corner.
Create a new project • From the Borland C++ main screen, click on File then New then Project to get to the New Target window:
In the Project Path and Name: text box, type: c:\temp\myprogs\prog1.ide • Notice that the Target Name is automatically taken from what you type. • In the Target Type: text box click on Application[.exe] to highlight it. • In the Platform: text box select Win32. • In the Target Model: text box select Console. • The remaining settings are as shown in the New Target window above and are not changed Now click on the Advancedbutton
Click in the .def and .rc boxes to deselect them so that the Advanced Options window looks like this: Now click on the OK button of the Advanced Options window. Then click on the OK button of the New Target window to complete the setup for the new project. You will then see the Project window…
The project is called prog1. The project file is prog1.ide in the c:\temp\myprogs directory. Within this project is a C++ (or C) file : prog1.cpp (or prog1.c). This is the source code file, the one that contains the text of the C++ or C program. prog1.exe is the name of the executable file to be generated from prog1.cpp (or prog1.c). • Now click on the filename prog1.cpp ( or prog1.c) to highlight it, and press the Enter key to open the file. You will see a code window for C:\temp\cpp\prog1.cpp (or prog1.c). The code window is where you to enter the text of your program.
Save the project In the title bar of the code window, there is a * after the source code file name. This means that the file has yet to be saved. To save the file, Click on File then Save.
Compile the project • To compile your source code (convert it to machine code) click on Project, and then Compile. If you have typed everything in correctly, you should see the following window (or a similar window for prog1.c). or
Click on OK. If there are any errors reported in this window, the program will not be compiled to machine code. You will need to find and correct the error, then compile again.
Run (execute) project Once you have 0 errors, you then have code which will run, once it is linked to the necessary library files. To compile, link and run a program which you know has zero errors, you can simply click on the lightening bolt button in the tool bar (the sixth button from the left which has a yellow wavy line on it). or