MSDN介绍:

  These files are used to build a precompiled header file Projname.pch and a precompiled types file Stdafx.obj.

  These files are located in the Projname directory. In Solution Explorer, Stdafx.h is in the Header Files folder, and Stdafx.cpp is located in the Source Files folder.

File name

Description

Stdafx.h

An include file for standard system include files and for project-specific include files that are used frequently but are changed infrequently.

You should not define or undefine any of the _AFX_NO_XXX macros in stdafx.h; see the Knowledge Base article "PRB: Problems Occur When Defining _AFX_NO_XXX". You can find Knowledge Base articles in the MSDN Library or at http://search.support.microsoft.com/.

Stdafx.cpp

Contains the preprocessor directive #include "stdafx.h" and adds include files for precompiled types. Precompiled files of any type, including header files, support faster compilation times by restricting compilation only to those files that require it. Once your project is built the first time, you will notice much faster build times on subsequent builds because of the presence of the precompiled header files.

  1:stdafx用于提高编译速度。如果不生成预编译头文件,每次编译器会编译所有cpp。然而,那些“频繁使用但改变很少的”文件不需要多次编译。为了提高编译速度,对这些文件使用预编译,编译器不需要多次重复编译。

  2:预编译生成的文件为Projname.pch和Stdafx.obj。

  3:不要使用_AFX_NO_XXX这样的宏定义。

  4:stdafx.h文件应放在cpp的第一行。在stdafx.h文件前面的所有代码将被忽略掉。(From百度百科等其他资料)

最新文章

  1. 使用rsync同步目录
  2. 教你实践ASP.NET Core Authorization
  3. java.io.File中的pathSeparator与separator的差异
  4. myeclipse中的js文件报错
  5. 管理IPv4网络连接
  6. Android Studio添加jar包
  7. Eclipse hangs on loading workbench, eclipse停在启动界面的处理办法
  8. svn执行clean up 操作时报错 "Previous operation has not finished; run 'cleanup' if it was interrupted"解决如下!
  9. new Random().nextInt
  10. Java的必备开发工具
  11. UWP: 在 UWP 中使用 Entity Framework Core 操作 SQLite 数据库
  12. HTML5 CSS3专题 诱人的实例 CSS3打造百度贴吧的3D翻牌效果
  13. 洛谷P1040 加分二叉树(树形dp)
  14. 安装jdk+tomcat
  15. body标签
  16. 变长编码表 ASCII代码等长编码
  17. windows编程之Windows Shell 编程
  18. 【Python028--引入文件】
  19. luffy之多条件登录与极验滑动验证码
  20. ReactiveX 学习笔记(4)过滤数据流

热门文章

  1. Objetive-C initialize研究
  2. osgOcean测试
  3. chapter5 函数
  4. FireFox站点标识按钮
  5. Channel Allocation(DFS)
  6. CentOS 7 安装Python pip
  7. python脚本文件删除
  8. Mongodb 抛出异常:dbexit: really exiting now
  9. H5加载优化
  10. 《Windows驱动开发技术详解》之定时器