[英]Does compiler compiles header files in C++?
like these are two headers files, now does compiler compiles these?像这些是两个头文件,现在编译器会编译这些吗?
#include<iostream.h>
#include<conio.h>
When any file is included with an #include
directive, the compiler processes its contents as if it were part of the source file being compiled当
#include
指令包含任何文件时,编译器会处理其内容,就像它是正在编译的源文件的一部分一样
actually it depends.实际上这取决于。
#include
mean that: hey compiler would you please copy content of that file inside this file(in preprocessing stage). #include
的意思是:嘿编译器,请您将该文件的内容复制到该文件中(在预处理阶段)。 after compiler copied content to given file then it will go for compiler now it depends.在编译器将内容复制到给定文件之后,它将 go 用于编译器,现在取决于它。 most compiler by default compiler compile given c++ files but other external functions and classes(for example stl and other third party libraries that not yours) will be find during run(which is dynamic library) the other side of dynamic library is static library which is instead of compiler compile specific files it goes for your dependencies and compile them along your code and put them together in this case programme does not need to find libraries during run which is why i said it depend.
大多数编译器默认编译器编译给定 c++ 文件,但其他外部函数和类(例如 stl 和其他不属于您的第三方库)将在运行期间找到(这是动态库)动态库的另一端是 ZA81259CEF8E959C624DF1D4 库而不是编译器编译特定文件,而是为您的依赖项编译它们并沿着您的代码编译它们并将它们放在一起,在这种情况下程序不需要在运行期间找到库,这就是我说它依赖的原因。
more information about compiler stages here .有关编译器阶段的更多信息,请点击此处。
more information about dynamic library and stl and dynamic library here .有关动态库和 stl 和动态库的更多信息,请点击此处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.