解决Visual Studio 2010的AlwaysCreate重建问题 [英] Solving the Visual Studio 2010 AlwaysCreate rebuild issue

查看:1175
本文介绍了解决Visual Studio 2010的AlwaysCreate重建问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我目前从移植到VS2008 VS2010一个C ++项目。当我生成项目,Visual Studio 2010的报告生成是成功的,但如果我那么preSS F5键启动调试有人告诉我,该项目是不是最新的。如果我忽略了这个警告,我还可以继续调试好了,但如果我preSS确定,整个项目(数百个源文件),被从头开始重建。输出包含以下;

I've a C++ project that I'm currently porting from VS2008 to VS2010. When I build the project, Visual Studio 2010 reports the build as successful but if I then press F5 to start the debugger I'm told that the project is not up to date. If I ignore this warning, I can continue debugging ok, but if I press ok, the whole project (many hundreds of source files), gets rebuilt from scratch. The output contains the following;

1>------ Build started: Project: SCCW-VC2010, Configuration: Debug Win32 ------
1>Build started 15/11/2010 14:47:40.
1>InitializeBuildStatus:
1>  Creating "Debug\SCCW-VC2010.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>Midl:
1>  All outputs are up-to-date.
1>ClCompile:
1>  tinedit.cpp
1>  _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1>  Automatically linking with sfl504d.lib
1>  Automatically linking with ot1104d.lib
1>c:\program files\rogue wave\stingray studio 10.4\include\toolkit\sectndlg.h(134): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>          c:\program files\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy'
1>  Automatically linking with og1204d.lib
1>  Automatically linking with RWUXThemeD10.lib
1>  profile.cpp
1>  ZOffsetDialog.cpp

半小时后,一旦构建完成,调试程序启动。我的猜测是,消息

Half an hour later, once the build is finished, the debugger starts. My guess is that the message

创建调试\\起重运输机械厂,VC2010.unsuccessfulbuild,因为AlwaysCreate指定。

是问题的一部分,但我不能配合这一个项目设置。我发现<一个href=\"http://connect.microsoft.com/VisualStudio/feedback/details/574245/alwayscreate-needs-documentation-or-vs10-fix\">some协助对谷​​歌,但没有什么迄今为止已经奏效。其他人有一个修复这个问题,知道吗?

is part of the problem, but I cant tie this to a project setting. I've found some help on google, but nothing that has worked thus far. Anyone else had this problem and know of a fix?

编辑:按Jalf的建议在下面的意见,我创建了一个新的预测,我进口的所有文件到该项目,新项目有同样的问题。具体来说,我复制了以下所有群体;

As per Jalf's suggestion in the comments below, I have created a new projected, imported all my files into that project, and the new project has the same problems. Specifically, I copied over all the following groups;

<ClCompile Include="..\MyDir\MyFile.cpp"/>
<ClInclude Include="..\MyDir\MyFile.h" />
<None Include="res\MyFile.ico" />  (and all similar resources)
<Library Include="..\MyDir\MyFile.lib" />

EDIT2:通过所有的头会包括我终于找到3根本不存在了。删除它们并做了重建所有原始项目似乎已经解决了这一问题。一些博客文章中提到这个问题提到它作为一个bug,和失去的时间,两天后,我倾向于同意。谢谢你提供的答案和注释。

After going through all the header includes I eventually found 3 that did not exist. Removing them and doing a rebuild all on the original project seems to have fixed the problem. Some of the blog posts that mention this problem refer to it as a bug, and two days of lost time later, I tend to agree. Thanks for the answers and comments provided.

EDIT3:并在一天后的问题又回来了!在项目进行任何编辑的任何文件再次导致完全重建。根据约翰Dibling的回答,该项目确实包括一些静态库,包括黄貂鱼。我抛弃VS​​2010和移动回VS2008,因为我有最后期限。有关信息,请参阅以下链接;

And one day later the problem is back! Making any edit to any file in the project once again causes a full rebuild. As per John Dibling's answer, the project does include some static libraries, including Stingray. I'm ditching VS2010 and moving back to VS2008, as I have deadlines. For related information, see the following links;

<一个href=\"http://stackoverflow.com/questions/2762930/vs2010-always-thinks-project-is-out-of-date-but-nothing-has-changed\">VS2010一直认为项目是过时的,但一切都没有改变

<一个href=\"http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/38c08137-3bb0-4143-b97f-72d077646318\">http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/38c08137-3bb0-4143-b97f-72d077646318

<一个href=\"http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx\">http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx

最后修改 VS2010 SP1的发布已经解决了这个问题,并建立现在是快速高效。

Final Edit The release of VS2010 SP1 has solved this problem, and builds are now fast and efficient.

推荐答案

我有这个问题很多次,它总是令人沮丧。我会告诉你,问题是在我的情况是什么,但首先我要问你:

I've had this problem many times and it was always frustrating. I'll tell you what the problem was in my case, but first I have to ask you:


  • 你做了重建,你尝试运行在首次使用前,或者只是重建?

  • 当你做一个重建所有,它要求你再次重建,如果你所做的任何更改?

在我的情况的问题是有些复杂。我自定义生成规则,对黄貂鱼从他们的源目录在我的构建树(他们住的地方)到一个目录拷贝二进制文件。二进制文件被标记为依赖关系,让他们在情况下,他们改变了每一个构建之前复制。

The problem in my case was somewhat complex. I had custom build rules that copies binaries for Stingray from their source directory (where they lived) to a directory in my build tree. The binaries were marked as a dependancy, so that they were copied before each build in case they changed.

检查的依赖关系看这些文件的时间戳,看的时候被改变了。如果 blah.lib 过去年十二月的mod迄今在它的源目录,然后当它被复制,将具有相同的模日期。该检查扶养会指出,嘿,这文件的pretty老了,我们要重建它,然后它会问,如果我想做一个完全重建。

The dependancy checked looked at the timestamps of these files to see when they were changed. If the blah.lib had a mod date of last December in it's source directory, then when it was copied it would have the same mod date. The dependancy checked would note that "hey this file's pretty old, we have to rebuild it," and then it would ask if I wanted to do a full rebuild.

有一段时间,我得到了由只是说不,但最终我通过更改自定义生成规则写一个新的文本文件,它没有文件复制后解决了这一问题。这将使新的文本文件的依赖关系,而不是 blah.lib 文件,这使编译器高兴。

For a while I got by by just saying "No," but eventually I fixed the problem by changing the custom build rule to write a new text file after it did the file copy. That would make the new text file the dependancy, and not the blah.lib file, and it made the compiler happy.

这篇关于解决Visual Studio 2010的AlwaysCreate重建问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆