stdafx是标准应用程序框架的扩展,即Standard Application Framework Extensions的简写,它是与预编译文件*.pch相关联的。一般MFC程序文件的第一句都为:#include 'stdafx.h'。我们要注意的一点就是:#include 'stdafx.h'之前的所有代码都会被忽略,因此我们在编写VS程序时这段代码应该放在首句,否则其他的头文件将会被忽略执行以出现这样的错误fatal error C1083: 无法打开包括文件: “stdafx.h”: No such file or directory
工具/原料
Visual Studio 2010或2012、2013
方法/步骤
1
新建一个控制台应用程序
2
将以下语句复制到主文件中#include 'stdafx.h'#include
3
编译运行即可通过