12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The <strong>C++</strong>Builder IDE Explored: Projects and Forms<br />

There are a few more odds and ends, but that’s the bulk of what is conta<strong>in</strong>ed <strong>in</strong> the makefile.<br />

When you tell <strong>C++</strong>Builder to compile the project, it hands the makefile to the compiler.<br />

(Technically, the makefile is read by the Make utility, but why quibble over details?) The<br />

compiler reads the makefile and beg<strong>in</strong>s compil<strong>in</strong>g all the source files that make up the project.<br />

Several th<strong>in</strong>gs happen dur<strong>in</strong>g this process. First, the <strong>C++</strong> compiler compiles the <strong>C++</strong> source<br />

files <strong>in</strong>to b<strong>in</strong>ary object files. Then the resource compiler compiles any resources, such as the<br />

program’s icon and form files, <strong>in</strong>to b<strong>in</strong>ary resource files. Next, the l<strong>in</strong>ker takes over. The<br />

l<strong>in</strong>ker takes the b<strong>in</strong>ary files the compilers created, adds any library files the project needs, and<br />

b<strong>in</strong>ds them all together to produce the f<strong>in</strong>al executable file. Along the way it produces more<br />

files that perform some special operations (I’ll get to that <strong>in</strong> a m<strong>in</strong>ute). When it’s all over, you<br />

have a standalone program that can be run <strong>in</strong> the usual ways.<br />

Okay, but what are all those files for? Table 6.1 lists the file extensions <strong>C++</strong>Builder uses, with<br />

a description of the role that each file type plays.<br />

Table 6.1. Types of files used <strong>in</strong> <strong>C++</strong>Builder.<br />

Extension Description<br />

.CPP The <strong>C++</strong> source files. There will usually be one for each unit and<br />

one for the ma<strong>in</strong> project file, as well as any other source files that<br />

you add to the project.<br />

.DFM The form file. This file is actually a b<strong>in</strong>ary resource file (.RES) <strong>in</strong><br />

disguise. It is a description of the form and all its components. Each<br />

form has its own .DFM file.<br />

.DSK The desktop file. This file keeps track of the way the desktop<br />

appeared when you last saved (or closed) the project. All the open<br />

w<strong>in</strong>dows’ sizes and positions are saved so that when you reopen the<br />

project it looks the same as it did when you left it.<br />

.EXE The f<strong>in</strong>al executable program.<br />

.H <strong>C++</strong> header files that conta<strong>in</strong> class declarations. These could be<br />

<strong>C++</strong>Builder-generated files or your own class headers.<br />

.IL? The four files whose extension beg<strong>in</strong>s with .IL are files created by<br />

the <strong>in</strong>cremental l<strong>in</strong>ker. The <strong>in</strong>cremental l<strong>in</strong>ker saves you time by<br />

l<strong>in</strong>k<strong>in</strong>g only the parts of the program that have changed s<strong>in</strong>ce the<br />

last build.<br />

171<br />

cont<strong>in</strong>ues<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!