c++ - stdafx.h 的目的

标签 c++ visual-c++ precompiled-headers stdafx.h

stdafx.h 文件的用途是什么?预编译头文件是什么意思?

最佳答案

stdafx.h is a file, generated by Microsoft Visual Studio IDE wizards, that describes both standard system and project specific include files that are used frequently but hardly ever change. Compatible compilers (for example, Visual C++ 6.0 and newer) will pre-compile this file to reduce overall compile times.

Visual C++ will not compile anything before the #include "stdafx.h" in the source file, unless the compile option /Yu'stdafx.h' is unchecked (by default); it assumes all code in the source up to and including that line is already compiled.

http://en.wikipedia.org/wiki/Precompiled_header

关于c++ - stdafx.h 的目的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2976035/

相关文章:

c++ - 为什么这个互斥代码没有按预期工作?

c++ - 预编译头 - 从所有其他文件中删除所有预编译头所必需的

c++ - 预编译 header 和 MSBuild

c++ - 强制CMake重建预编译的头文件

c++ - 复制初始化的奇怪行为,不调用复制构造函数!

C++ "simple"具有任意参数和返回值的函数的函数回调

c++ - 使用 C++ 获取亚洲字符的文本文件

c++ - 在 VC6 中使用 VS 2005 库时出现编译错误

c++ - while 循环的迭代返回奇怪的值

c - 为什么 Visual Studio 2010 两次包含头文件?