Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VC++2008 project always "out of date"

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?

like image 229
feuGene Avatar asked Jul 30 '10 13:07

feuGene


People also ask

What is the difference between solution and project?

A project is contained within a solution. Despite its name, a solution isn't an "answer". It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.

What is a solution. net?

Solutions are the containers for all your work in VS.NET. A solution contains a project for each build output. (For example, if you want to build a DLL, an EXE, and an MSI Installer file, your solution will contain three projects.) Projects themselves contain source files.

What is build solution in Visual Studio?

Build solution: Compiles code files (DLL and EXE) which are changed. Rebuild: Deletes all compiled files and compiles them again irrespective if the code has changed or not. Clean solution: Deletes all compiled files (DLL and EXE file).

What is solution in c#?

A solution is a container to organize one or more related code projects, like a class library project and a corresponding test project.


2 Answers

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.

like image 151
wilx Avatar answered Sep 23 '22 15:09

wilx


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.

like image 29
Dimitri C. Avatar answered Sep 26 '22 15:09

Dimitri C.