0

I am having a very strange problem with Visual Studio 2008. I searched here on SO for similar problems with the "Project Out of Date" dialog, but their problem was that either they were using a header file that is deprecated/no longer exists, or their problem was occuring while building a multi-project solution or it had other dependencies.

My project is a Win32 Console application, I went to File->New->Project...->Win32 Console Application. I used the default settings (precompiled header is checked), and I didn't change a single line of code in the project, as soon as the project created I pressed the debug button (though I get the exact same problem when I set the build target to Release).

[main.cpp]

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}

^ Very standard source file, right? Well, no matter what I build in any project VS2008 tells me it is out of date. Why? This problem may not prevent me from building the project, but I would very much like everything to be in order and never have to see this dialog again. Again, I looked at similar questions, but their solutions involve removing some extra dependency or something of the sort, none of which applies to my situation.

Why might VS2008 be nit-picking on its own project template?

halfer
  • 19,824
  • 17
  • 99
  • 186
Brandon Miller
  • 2,247
  • 8
  • 36
  • 54
  • What happens when precompiled header is not checked? – Jesse Good Sep 06 '12 at 04:30
  • Nothing really, just wanted to provide as much info as possible. Only thing it means is the header will compile on every build instead of being compiled once in a .pch file, still get the same dialog – Brandon Miller Sep 06 '12 at 06:26
  • 1
    Yes, I know that. [See here](http://stackoverflow.com/questions/2762930/vs2010-always-thinks-project-is-out-of-date-but-nothing-has-changed) for a long list of solutions (they should mostly be applicable to vs2008 also). Also, read your `BuildLog.htm` and check for warnings, etc. which should give you a hint as to what is the problem. – Jesse Good Sep 06 '12 at 06:43
  • Yeah I misunderstood what you meant my bad for implying you didn't know what precompiled headers do lol. And +1 for the BuildLog suggestion I did not think to check that, but I already deleted all the test projects that gave me the warning, I finally just checked "Don't show me this dialog again" which it just occured to me that that is the reason I no longer get the warning *facepalm* (thought it was fixed haha) – Brandon Miller Sep 06 '12 at 14:08

1 Answers1

0

If a source file (including include files) somehow got a date time some time in the future, then the compiler will think the object files are always out of date.

Steve Wellens
  • 20,506
  • 2
  • 28
  • 69
  • I'm sorry but I don't quite get "got a date time some time in the future", are you saying this problem has something to do with an actual timestamp on the files? I could edit my post to show all of the included files as well. – Brandon Miller Sep 06 '12 at 04:11
  • 1
    I'm saying it is something to check. Sometimes the server that a source control system is on may have the date incorrect. Sometimes, it's a 3rd party file. Say the date time on a source file (your source file or included header file or lib file, etc.) is 2050 12:00 AM. When the compiler decides what to build, it will see the object files and exe/dll file is OLDER than the source file and rebuild. – Steve Wellens Sep 06 '12 at 13:36
  • Oh okay, I see what you mean. Though I don't use a source control system and it said it was out of date on the first build of the freshly made project. I made several different test project solutions, the first 3 gave me the same dialog, the last one however did not. It's strange. But thanks for explaining this because I thought the dialog meant that something in the project was deprecated but now I see it has to do with timestamps, I'll go ahead and accept this as an answer, seeing as how I now understand the problem better, and for some strange reason I am not having it anymore :) – Brandon Miller Sep 06 '12 at 14:03