Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What's the difference between Building and Compiling.

share|improve this question
add comment

4 Answers

up vote 11 down vote accepted

Compiling is part of a build process.

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

share|improve this answer
add comment

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.

share|improve this answer
1  
"Building is done when preparing an application for release" - don't tell that the continous integration crowd ;) Or any other avid user of automatic builds, for that matter. –  delnan Mar 18 '12 at 18:53
1  
@delnan: Agreed. Continuous integration creates many "builds" over the lifetime of an application. However, any or all of these builds could be used in preparation for a public release. It depends on your build, test and approval processes. –  Bernard Mar 18 '12 at 18:58
3  
Well, according to the continous delivery crowd, each of these builds should be ready for release. But practice says otherwise, and generally "builds" may serve any purpose that is aided by getting the software ready to run and testing it. Debug builds, for instance. Or checking that your changes didn't break any of the 16 million tests. –  delnan Mar 18 '12 at 19:00
2  
@delnan - What about a build that fails its tests? By the standards of the continuous delivery crowed, it is a build but not ready for release :) –  Oded Mar 18 '12 at 19:05
add comment

"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.

share|improve this answer
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.