Build or compile

后端 未结 6 978
终归单人心
终归单人心 2020-12-28 18:17

I have a theoretical question about the difference between compile and build. I\'m programming in a c++ project that takes a lot of time to build, so I have told to do build

6条回答
  •  心在旅途
    2020-12-28 18:30

    "Building" is a vague term that usually means the entire process, preprocessing, compiling and linking. Which parts of these processes have to be redone after a source change depends on what has changed. If you only changed a single .cpp source, it's enough to recompile it and link the objects again. If you change a .h header, all source files that include this header have to be recompiled, which is usually expensive as project-specific headers tend to be included in many source files.

    In short, if you have made a change to the source, all files affected by this have to be recompiled and the entire binary has to be re-linked.

提交回复
热议问题