我如何确保当.h文件被修改时,包括它的.cc文件在使用Visual Studio 2008的版本构建中自动编译? [英] How do I make sure that when a .h file is modified, the .cc files including it are compiled automatically in a Release build using Visual Studio 2008?

查看:116
本文介绍了我如何确保当.h文件被修改时,包括它的.cc文件在使用Visual Studio 2008的版本构建中自动编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我在Visual Studio 2008项目中有a.h,a.cc和b.cc。 a.cc和b.cc都包括a.h.当我修改a.h并构建项目时,a.cc和b.cc将在Debug版本中编译。但是,在发行版本中不是这样。在发布版本中,只有当a.cc和b.cc已被修改时,它们才被编译。看来编译器没有跟踪发行版本中.cc文件的依赖。

Say I have a.h, a.cc, and b.cc in my Visual Studio 2008 project. Both a.cc and b.cc include a.h. When I modify a.h, and build the Project, a.cc and b.cc are compiled in the Debug builds. However, that is not the case in Release builds. In the Release builds, a.cc and b.cc are compiled only if they have been modified. It seems that the compiler does not keep track of the dependencies of .cc files in the Release builds.

有没有一些编译器标志可以解决这个问题?如果没有,是否有其他方法来处理这个问题?

Is there some compiler flag that will fix this problem? If not, are there other methods to deal with this problem?

推荐答案

编译器应该自动进行,偶尔出现,通过触摸文件,与源控制交互,甚至夏令时。在Build菜单中,选择Clean,这应该重置所有临时文件,这应该使一切重新同步。

The compiler should be doing that automatically, though the problem does arise occasionally, by touching the files, interacting with source control, or even daylight savings. In the "Build" menu, select "Clean" and that should reset all the temporary files, which should make everything re-synchronize.


此外,如果您在编译之间更改系统时钟。我有时要做的
这有时在测试的东西。 - John Dibling

Also if you change your system clock between compiles. I have to do this sometimes when testing things. – John Dibling

这篇关于我如何确保当.h文件被修改时,包括它的.cc文件在使用Visual Studio 2008的版本构建中自动编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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