visual-studio-2010visual-studiovisual-c++visual-studio-debuggingbuilding

Visual Studio 2010 F5 Debugging C++ is not Rebuilding


I have a Visual Studio 2010 Ultimate C++ project (not managed or .NET). When I press F5 (i.e., start debugging), I want it to save all the files, rebuild those that changed, link the whole thing, and then run. Instead, it appears to use the last build. Thus, when I try to step into a function or something, I get the following error:

Visual Studio Changing Error

Based on my research, I have verified these options, the first three of which are in the Options dialog (can be reached under "Debug->Options and Settings"):

I have also tried deleting all Debug and Release directories as well as the .sdf and ipch directory.

For completeness, I suppose I should mention that I'm using precompiled headers, though I kinda doubt it matters.

[EDIT: I should note that it only seems to be one file (a .h file) that's doing it. I tried renaming it and recompiling, and also removing it from the solution and adding it back in, but it didn't work. ]


Solution

  • Once I had similar problem with my C# project and I think I have tried every possible suggestion available on internet but none worked and then this is what I have done:

    1. Created an empty Project
    2. Added startup function to verify that it does not show any error
    3. Imported all my source code manually one by one

    So, Yes, it was the solution. You already have done a lot so I would say you can get lucky by trying here and there however having a new project and importing your individual source file would be faster.