VC++2008 project always “out of date”

2019-06-22 05:04发布

In one Solution, I have two VC++ projects. Project A has linker inputs that are .obj files compiled by project B.

Visual Studio (2008) always tells me that project A is "out of date," and prompts me to ask if I want to rebuild it, every time I want to run/debug/build/etc. Even immediately after building the entire Solution: I do a successful full build, and then click Build again, and it wants to re-link Project A.

How can I prevent this from happening? Anyone understand what's going on here?

3条回答
做个烂人
2楼-- · 2019-06-22 05:35

I think that the solution is to stop using .obj files from the other project. Instead, factor the code that is common to both A and B projects into own static library C and link both A and B to it.

查看更多
太酷不给撩
3楼-- · 2019-06-22 05:35

Had something similar occur. I was working with code that used the system time and during the debug I was twiddling with it quite a lot. Somehow the files got some bad timestamps. In the build, it shows which files are getting recompiled, so I just opened each, forced a change (add space, delete a space) and then re-saved.

Similar to the old unix "touch".

In one project I had to do the same to its include files. But after 'touching' the files like that, the problem went away.

查看更多
beautiful°
4楼-- · 2019-06-22 05:49

I just had this problem with Visual Studio 2010 (both with and without SP1) and thanks to Ted Nugent I was able to fix it. The trick is to check whether all C++ header files listed in the project still exist, and remove the non-existing ones. Apparently this is a bug in the compiler.

查看更多
登录 后发表回答