'What is the difference between compiling and building in Delphi?

With Delphi-6 there are two options: Build and Compile.

I know when I run a program it compiles only the files which have changed and uses the DCUs for those which haven't. When I click build apparently it rebuilds the DCUs.

What I have been wondering is, when I make a program for release (changing build settings, conditional variables, etc.) can I just compile, or do I have to do a full build?

What happens if I don't do a full build, is there any consiquence?



Solution 1:[1]

@Daisetsu, here is the difference between build and compile.

Build compiles all used units in an project when the source code is available.

Compile compiles only changed used units.

in my personal experience when you make changes to the configuration of the compiler, you must execute a build of the application, so that changes will be reflected in all units of the project.

Solution 2:[2]

You should always Build when changing settings.

The previously compiled DCU files may have been compiled with different settings, such as compiler defines. Which can cause two units in the same project to be compiled with different settings.

Solution 3:[3]

When preparing a release you should most certainly do a full build.
There is no excuse not to, Delphi's compiler is quite fast enough.

Clarifying Importance of Reproducible Release

  • When preparing a release you will have a version of your product that other people will be using.
  • If they report issues, you may need to go back to that version to test & fix the problem.
  • If you did not do a full build, but instead relied existing DCU's there is a chance that one of your source files did not get recompiled.
  • Even if that possibility is rather slim, that chance can seriously hamper your ability to resolve the issue quickly.
  • This problem gets worse as a system gets larger, has more inter-dependencies, and has more versions 'supported in the wild'.

For your own sanity, I strongly urge that you always do full build for a releasable version.
I regularly do full builds even for non-releasable versions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RRUZ
Solution 2 Robert Love
Solution 3