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