什么是StdAfx.h,我应该如何使用它 [英] What is StdAfx.h and how should I use it

查看:646
本文介绍了什么是StdAfx.h,我应该如何使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我们在Visual Studio中创建任何C ++项目时,默认情况下会创建StdAfx.h,即预编译头".我在Google上浏览了很多页面,但是并没有完全了解它的用法.能否请您提供一些说明.

问候

Hi,

When we create any C++ project in Visual Studio, by default it create StdAfx.h which is known as ''precompiled header''. I have gone many pages on Google, but didn''t exactly understand it''s usage. Can you please provide some light on it.

Regards

推荐答案

预编译头文件通过在其中添加经常需要的包含文件来减少编译时间.
查看Google或此Wikipedia链接:
http://en.wikipedia.org/wiki/Precompiled_header [
Precompiled headers are used to reduce the compile time by adding often required include files there.
See Google or this Wikipedia link:
http://en.wikipedia.org/wiki/Precompiled_header[^]
I would recommend, that you add the include files that most of your other application code requires to the stdafx.h. This significantly reduces the time to build your project.


这篇关于什么是StdAfx.h,我应该如何使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆