Visual Studio rebuilds forever

Posted by: Jason Hughes in programming on  

A small tidbit for frustrated developers.  I have Visual Studio 2005 and generally like it a lot... still lacks some of the features that we had in 1995 with VC6, but the improvements have grown on me.  However, occasionally I'll run into a serious snag that makes no sense and I have to spend hours or days worrying about it.  Here's one of them, and how to solve it:

I have a large solution with about 50 projects in it, mostly libraries.   I had all the dependencies set correctly and everything was great.  One day, I added a project and stuck all of libjpeg in there.  Suddenly, whenever I compiled anything, it was rebuilding continually.  After a week or two of being angered by this, I finally took the time to figure out what was going on.  I noticed that even though I told it to do Minimum Rebuild (/Gm), there was never an .idb file written next to the .pdb file.  Turns out that for this and several other projects that contain only .c files, I have to disable Minimum Rebuild which for some reason writes out an .idb and fixes the issue.  I believe this has to do with the library containing only .c files and defining no classes.  Forcing the build type to C rather than C++ does not change this behavior.  And seeing as how such things are tough to figure out, I wanted to post it on the off-chance it helps someone.

JH