did you forget to add stdafx.h problem

1. in vs environment program, if you don't add stadfx.h file to *.cpp file,the compiler will  recommend this error.
    the solution for this err is :

  property/c/C++/Precompileed Headers/Precompiled Header to "not Using Precompiled Headers".


2. stdafx.h文件介绍:

由于Windows和MFC的include文件都非常大,并且每个.CPP文件都包含相同的include文件,为每个.CPP文件都重复处理这些文件就会非常不值得,为了节省编译时间,AppWizard在生成工程文件时,会自动生成stdafx.h以及stdafx.cpp文件。在编译过程中VisualC++和AppWizard所做的工作为:

   (1)AppWizard生成文件stdafx.h,该文件包含了当前工程文件需要的所有的MFCinclude文件,这一文件随着选择的选项尔变化;
   (2)AppWizard然后生成stdafx.cpp,这个文件通常都是一样的;
   (3)AppWizard生成工程文件,此时第一个被编译的文件就是stdafx.cpp文件;
   (4)VisualC++编译stdafx.cpp文件时,它将结果保存在一个名为stdafx.pch的文件里。(扩展名pch表示预编译头文件。)
   (5)VisualC++编译其它剩余的.cpp文件时,它将会使用stdafx.pch文件。VisualC++不再分析编译Windowsinclude文件,除非stdafx.cpp或stdafx.h这两个文件又有了新的变化。


stdafx.pch文件是编译之后一个非常大的文件,此文件中包含了大量的函数符号信息。


参考信息:http://blog.csdn.net/zhang_hui_cs/article/details/7541583


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值