在stdafx.h中#include是个坏主意吗? [英] Is #include inside stdafx.h a bad idea?

查看:90
本文介绍了在stdafx.h中#include是个坏主意吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的Visual Studio 2005应用程序中,我们有几个应用程序'

H文件#include到stdafx.h.


奇怪的是,当我们更改那些应用程序H文件时,VS2005

并没有触发整个应用程序的重建(或任何东西,为此

问题)。


这是一个设置吗?


谢谢!

Chris

In our Visual Studio 2005 application, we have several of our application''s
H files that are #included into stdafx.h.

What is odd, is that when we change those application H files, VS2005
doesn''t trigger a rebuild of the entire app (or of anything, for that
matter).

Is this a setting somewhere?

Thanks!
Chris

推荐答案

Chris Shearer Cooper写道:
Chris Shearer Cooper wrote:

在我们的Visual Studio 2005应用程序中,我们有几个我们的

应用程序'的#dlude包含在stdafx.h中。
In our Visual Studio 2005 application, we have several of our
application''s H files that are #included into stdafx.h.



我认为它正是预编译头的用途。

I thought that it is exactly what the precompiled headers are for.


什么是奇怪的,是当我们更改那些应用程序H文件时,VS2005

不会触发整个应用程序的重建(或者任何事情,对于那个

问题)。


这是一个设置吗?
What is odd, is that when we change those application H files, VS2005
doesn''t trigger a rebuild of the entire app (or of anything, for that
matter).

Is this a setting somewhere?



你不应该将'stdafx.cpp'添加到你的项目中,因为

和'stdafx一样。 H''?那就是应该触发重新创建

预编译头文件并进一步重新编译模块...


或者只需关闭预编译头文件(他们在吗?)


V

-

请在回复e时删除资金'A' -mail

我没有回复最热门的回复,请不要问

Aren''t you supposed to have ''stdafx.cpp'' added to your project as
well as ''stdafx.h''? That''s what should trigger re-creation of the
precompiled headers and further recompilation of the modules...

Or just turn them precompiled headers off (are they on?)

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


文章< 12 **** *********@corp.supernews.com>,

Chris Shearer Cooper< ch ******* @ sc3.netwrote:
In article <12*************@corp.supernews.com>,
Chris Shearer Cooper <ch*******@sc3.netwrote:

>在我们的Visual Studio 2005应用程序中,我们将几个应用程序的H文件#include包含在stdafx.h中。
>In our Visual Studio 2005 application, we have several of our application''s
H files that are #included into stdafx.h.


>奇怪的是,当我们更改那些应用程序H文件时,VS2005
并没有触发重建整个应用程序(或任何东西,对于那个
问题)。
>What is odd, is that when we change those application H files, VS2005
doesn''t trigger a rebuild of the entire app (or of anything, for that
matter).



我看到很多项目都没有编译每个依赖的cpp文件

当Resource.h被更改时。这是一种头文件你要改变吗?顺便说一句,你可以将预编译的头文件重命名为

,这样更有意义 - 无需跟上MS-DOS 8.3

文件名或键盘错误这变成了(糟糕的)

标准。


Nathan Mates


-

< * Nathan Mates - 个人网页 http://www.visi.com/ ~nathan /

#Pandemic Studios的程序员 - http ://www.pandemicstudios.com/

#不代表Pandemic Studios。 不要关心邻居们是什么?#b $ b#想想。什么是事实,以及小数位数是多少? -R.A. Heinlein

I''ve seen a lot of projects not compile every dependent cpp file
when Resource.h is changed. Is this the kind of header file you''re
changing? Btw, you can rename your precompiled headers to something
that''s a lot more meaningful - no need to keep up with MS-DOS 8.3
filenames or a bad keyboard splattering that became a (lousy)
standard.

Nathan Mates

--
<*Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein


stdafx.h和stdafx.cpp都包含在项目中。


" Victor Bazarov" < v。******** @ comAcast.netwrote in message

news:ep ********** @ news.datemas.de ...
Both stdafx.h and stdafx.cpp are included in the project.

"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ep**********@news.datemas.de...

Chris Shearer Cooper写道:
Chris Shearer Cooper wrote:

>在我们的Visual Studio 2005应用程序中,我们有几个
应用程序的#include到stdafx.h中的H文件。
>In our Visual Studio 2005 application, we have several of our
application''s H files that are #included into stdafx.h.



我认为它正是预编译标题的用途。


I thought that it is exactly what the precompiled headers are for.


>什么是奇数,当我们更改那些应用程序H文件时,VS2005不会触发整个应用程序的重建(或任何事情,对于那个
问题)。

是这个设置在某个地方?
>What is odd, is that when we change those application H files, VS2005
doesn''t trigger a rebuild of the entire app (or of anything, for that
matter).

Is this a setting somewhere?



您不应该将'stdafx.cpp'添加到您的项目中作为'/ b $ b以及'stdafx。 H''?那就是应该触发重新创建

预编译头文件并进一步重新编译模块...


或者只需关闭预编译头文件(他们在吗?)


V

-

请在回复e时删除资金'A'邮件

我没有回复最热门的回复,请不要问


Aren''t you supposed to have ''stdafx.cpp'' added to your project as
well as ''stdafx.h''? That''s what should trigger re-creation of the
precompiled headers and further recompilation of the modules...

Or just turn them precompiled headers off (are they on?)

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask



这篇关于在stdafx.h中#include是个坏主意吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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