53

What's the difference between Building and Compiling.

Dynamic
  • 5,786
Vishwas
  • 541

4 Answers4

51

Compiling is part of a build process.

A build process can include testing, packaging and other activities apart from compilation.

Oded
  • 53,734
30

"Building" is a fairly general term, and it can refer to anything that is needed to go from editable source material (source code, scripts, raw data files, etc.) to a shippable software product. Building can (and usually does) involve several steps, such as pre-processing, compiling, linking, converting data files, running automated tests, packaging, etc.

"Compiling" is more specific, and almost invariably refers to a process that takes source code as its input, and outputs something runnable, typically machine code for either a physical or virtual machine, or source code in a different language.

tdammers
  • 52,936
15

These terms are often used interchangeably, but I would differentiate them in the following way:

  • Building is done when preparing an application for release, which includes compiling, packaging, testing, etc.
  • Compiling is done at any time the compiler is involved in translating programming language code to machine code.

Thus, compiling is really a subset of building.

Bernard
  • 8,869
4

Compiling is done by compiler, build can be more complex process.

Eg. in C++ to make a build of a project you need preprocessor (preprocessing of source files); compiler (compiling of source files); linker (merging everything into executable - compiled code, icons, strings, other resources together)

So generally compiling is translating code written in one language to another (eg. machine code).

Slawek
  • 2,892