A project is a way of grouping the files that make up a program,
so that when you compile the program it knows which files to use. In
Unix, we don't need a project, because in the g++ command we list all of
the .C files that make up the program, and the compiler compiles all of the
files we listed. In Turbo C++, if we only have one file
in our program then we compile and run that file. But when we have a program
made up of multiple files, we must add all of the
files to a project, and then when we build the project, it compiles all of
the .cpp files in the project to create our program.
The following steps describe how to create a project in Turbo C++.
-
Select one of the files in your program as the active window.
-
Choose New Project from the Project menu.
-
Choose a name for your project. Enter the project name in the box
called Target Name. In the Project Path and Name
box, enter the correct
path, ending with the same project name you used in the
Target Name box.
The path should point to the directory that contains your program.
Choose EasyWin as the Target Type by
clicking on it once. Click on OK.
-
In the project window which now appears at the bottom of your screen,
delete the .rc and .def nodes
from the project. You can delete a node by right clicking on the node
and selecting delete from the pop-up menu. There will also be a .cpp
node which has the same name as the .exe node. If you don't have a .cpp
file with this name in your program, delete this node from the project too.
-
Click on the first line in the project window - the .exe node, which
is the target of the project (the program the project will build). Now
right click on the target and choose add node from the pop-up menu.
An Open window will appear; select one of the other files in your program.
-
Continue to add nodes until you have added all the .cpp and .h files
which are part of your program.
-
Your project is now ready. Choose Make All or Build All from the Project
menu to build your project. After the build completes successfully, you
can run your program by double clicking on the target in the Project
Window, or by clicking on the Run button (the lightening bolt).
-
If you want to work on a different program, close the project by choosing
Close from the Project menu.