1

I have a common problem with Visual Studio 2010 and my C++ project. Some times ago Visual Studio started to show the "project is out of date" on every "F5" hit regardless if i change something or not. I have searched google and found many reasons, including this stackoverflow question that contains instructions on how to enable system logging. I have enabled system logging, and what i see here puts me into shock and awe:

[2104] Project 'projectname.win32.vcxproj' not up to date
because 'filename.h' was modified at 07/21/2011 09:02:54,
which is newer than '' which was modified at 01/01/0001 00:00:00. 

Any ideas that is this '' that was modified 01.01.01?

Community
  • 1
  • 1
grigoryvp
  • 40,413
  • 64
  • 174
  • 277
  • Does it still happen if you remove `filename.h` from the project then re-add it? (Maybe perform a build before re-adding it, even if the build will be broken). – Michael Burr Jul 23 '11 at 17:02
  • I have removed it from the project (this does not affect compilation since it is a header file). And more weird thing - SYSTEM LOG MESSAGE IS SAME! I have searched filesystem for mentioned file name and the ONLY place it is mentioned is another .h file in my project where it is included. It is NOT mentioned in .vcxproj file. And still Visual Studio finds it :(. – grigoryvp Jul 23 '11 at 17:34
  • I'm wondering if there's something odd in the file that's valid C++ but might confuse whatever parser VS uses to figure out dependencies. You might try stripping things out of the file until the problem goes away - of course that's assuming the problem is due to the contents of the file, which might not be the case. – Michael Burr Jul 23 '11 at 19:19

2 Answers2

2

For the record: the problem was caused by intermediate directory being set to $(TEMP)\$(ProjectName)_int\$(Configuration)\. Changing it to relative ..\out\$(ProjectName)_int\$(Configuration)\ Completely solves the problem. Seems like one of the many visual studio bugs O_O.

grigoryvp
  • 40,413
  • 64
  • 174
  • 277
1

Does filename.h actually exist? Is filename.h listed in Solution Explorer? When a header has been deleted from disk but not removed from a project, the project engine will always attempt rebuild.

sean e
  • 11,792
  • 3
  • 44
  • 56
  • Of course it exists since it has a modification time :). But to be sure, i just copy the file name, pasted it into explorer window at it successfully opens. – grigoryvp Jul 23 '11 at 15:33
  • @Eye I was thinking that the time that was logged could have been the time that the project engine cached when it last saw the file. – sean e Jul 23 '11 at 15:36
  • @Eye - does it log the full path or just the name? If just the name, has it moved to a different directory? – sean e Jul 23 '11 at 15:37
  • Full path, i removed it from message for illustrative purpose. – grigoryvp Jul 23 '11 at 17:16