简体   繁体   English

如何确保在修改.h文件时,使用Visual Studio 2008在Release版本中自动编译包括它的.cc文件?

[英]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.

相关问题 当我安装了多个Visual Studio版本时,如何使用Visual Studio 2008构建增强功能? - How do I build boost with Visual Studio 2008 when I have multiple Visual Studio versions installed? 包含文件时,如何告诉Visual Studio使用项目目录而不是当前文件目录? - How can I tell Visual Studio to use the project directory instead of the current file directory when including files? 在Visual Studio 2008中调试时如何管道输出? - How do I pipe output when debugging in Visual Studio 2008? 在visual studio中自动添加要编译的文件 - Automatically add files to be compiled in visual studio 我在哪里可以找到MPFR的Visual Studio 2008项目构建文件? 或者如何自己创建这样的构建文件? - where can I find a Visual studio 2008 project build file for MPFR? or how to create such build file myself? 如何使用 Visual Studio 2008 从 qt.ui 中生成.h 文件? - How to generate .h file out of qt .ui with visual studio 2008? 自动将源文件包含到Visual Studio 15中 - Automatically including source files into Visual Studio 15 如何使用GLFW预编译二进制文件编译Visual Studio 2019版本构建 - How to compile Visual Studio 2019 release build with GLFW pre-compiled binaries 如何在命令行上构建Visual Studio 2008 C ++项目的所有配置? - How do I build all configurations of a Visual Studio 2008 C++ project on the command line? 如何让Visual Studio将所需的.dll文件复制到release文件夹中? - How can I make Visual Studio copy the required .dll files into the release folder?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM