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?

China☆狼群 提交于 2019-12-12 18:52:03

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/12982025/how-do-i-make-sure-that-when-a-h-file-is-modified-the-cc-files-including-it-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!