vs2008每次build都会重新编译链接 && 项目已经过期

转自:http://blog.csdn.net/movezzzz/article/details/6816605

无外乎两种情况:

1.时间问题,所创建的文件的时间比如是:2011-09-22 09:03:22,那么你的系统时间之前被你改动过当前时间是:2011-08-22 09:03:22。这下好了,vs每次编译的时候都会检查每个文件的最后修改日期,发现是上一个编译时间之后的,都会重新编译。所以在这一个月内,每次都会重新编译文件。

解决办法:

a.将文件稍作修改,加个注释之类的。然后重新保存,让其和系统时间一致。这样的话,可能有大量的文件,都需要这样做。

b.最好的方法,还是直接修改系统的时间。让其正常。就能解决。


2.如果,不是时间问题呢?那就是:没有启用/Gm编译选项。

解决办法:

设置工程属性,为以下选项:
C/C++ -> Code Generation -> Enable Minimal Rebuild: Yes(/Gm)
C/C++ -> Genera -> Debug Information Format: Program Database for Edit & Continue (/ZI), 或者 Program Database (/Zi)


得解,反正,我的是通过第二种方案解决的。


【项目已经过期解决方案】

To find the missing file(s), use info from the article Enable C++ project system logging to enable debug logging in Visual Studio and let it just tell you what's causing the rebuild:

Open the devenv.exe.config file (found in %PROGRAMFILES%\Microsoft Visual Studio 10.0(or others)\Common7\IDE\)
Add the following after the </configsections> line:

复制内容到剪贴板
代码:
<system.diagnostics>
  <switches>
    <add name="CPS" value="4" />
  </switches>
</system.diagnostics>
Restart Visual Studio
Open up DbgView and make sure it's capturing debug output
Try to debug (hit F5 in Visual Studio)
Search the debug log for any lines of the form:

devenv.exe Information: 0 : Project 'Bla\Bla\Dummy.vcxproj' not up to date because build input 'Bla\Bla\SomeFile.h' is missing.

(I just hit Ctrl+F and searched for not up to date) These will be the references causing the project to be perpetually "out of date".

To correct this, either remove any references to the missing files from your project, or update the references to indicate their actual locations.


http://stackoverflow.com/questio ... nothing-has-changed

posted @ 2014-12-28 17:53  huoyao  阅读(1310)  评论(0编辑  收藏  举报