Home Segments Index Top Previous Next

691: Mainline

Note that, if you change just one source-code file, you need only to recompile it into an object file and link it with the object files previously produced from unchanged source-code files. You save time, because you do not have to wait for your C++ compiler to produce object code from most of your source-code files.

Suppose, for example, that you have a working analyze_train program, but you make a change in the trains.cxx source-code file. You therefore need to recompile trains.cxx:

CC -c trains.cxx 

Then, you need to relink the object files:

CC -o analyze_train trains.o containers.o cars.o 

You do not, however, need to recompile containers.cxx or cars.cxx.