[英]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?
Say I have ah, a.cc, and b.cc in my Visual Studio 2008 project. 说我的Visual Studio 2008项目中有ah,a.cc和b.cc。 Both a.cc and b.cc include ah When I modify ah, and build the Project, a.cc and b.cc are compiled in the Debug builds.
a.cc和b.cc都包含ah当我修改ah并构建项目时,a.cc和b.cc会在Debug版本中进行编译。 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.
在发布版本中,仅当a.cc和b.cc被修改时才进行编译。 It seems that the compiler does not keep track of the dependencies of .cc files in the Release builds.
似乎编译器无法在Release版本中跟踪.cc文件的依赖性。
Is there some compiler flag that will fix this problem? 是否有一些编译器标志可以解决此问题? If not, are there other methods to deal with this problem?
如果不是,是否还有其他方法可以解决此问题?
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.
在“构建”菜单中,选择“清除”,这将重置所有临时文件,这将使所有内容重新同步。
Also if you change your system clock between compiles.
同样,如果您在两次编译之间更改系统时钟。 I have to do this sometimes when testing things.
测试某些东西时,我有时必须这样做。 – John Dibling
– John Dibling
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.