构建或编译 [英] Build or compile
问题描述
我对编译和构建之间的差异理论问题。我在一个C ++项目,需要花费大量的时间来建立编程,所以我已经告诉做建设只是在我修改了任何头文件的案件。真的吗?如果我在一个叫头文件中添加一个新的属性,然后做我必须建立?不够编译?
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 just in the cases in where "I have modified any header file". Is that true? If I add a new attribute in a headder file, then do I have to build? Is not enough compiling?
谢谢!
推荐答案
楼是一个模糊的术语,通常是指在整个过程中,preprocessing,编译和链接。这些过程的部分必须重做源的变化取决于发生了什么变化了。如果你只改变了一个的.cpp
源,它足以重新编译,并再次链接的对象。如果更改 .H
头,的所有的,包括这个头已经重新编译,这通常是昂贵的源文件为具体项目的头倾向要包括在许多的源文件。
"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.
这篇关于构建或编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!