views:

12

answers:

1

My dev environment at work consists of a Visual Studio 2005 Solution with many sub-projects (by "project" I always mean VS project). Some of the projects build libraries which are used by other projects. By convention, a fair amount of test-related code ends up in header files which end up getting modified frequently. I've noticed that when I hit F7 to Build the solution, Visual Studio does not detect changes to header files that are in library projects. It will report that everything is up to date when it's not. To force it to rebuild the libary, I have to change (touch) one of the .c files in that particular project, or do Rebuild All which is quite slow.

Is there something I can change in the Solution or project settings to change this behavior so Build works as expected? I've actually gone so far as to hack together a script that "touches" one of the library .c files in a library when it detects an .h file has been updated, but there has got to be a VS solution to this.

A: 

Are the header files actually members of the library project - not just in an include file search path?

Michael Burr
Yes. The files exist in a subdirectory of the library, and I've done "Add Existing Item" to explicitly add them so they show up in the project's file tree.
LVB
Are you using pre-compiled headers? There's a thread here: http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/c7b692cc-aca0-4a50-b8df-36728f2b68e1/ discussing a problem similar to what you're describing. See if disabling precompiled headers solves the problem. If that fixes the problem, you may want to live without precompiled headers (or you might be able to work around the problem by excluding your project's headers from the set of those that are precompiled).
Michael Burr
No, not on this product. Thanks for the link though for future reference as I wasn't aware of that issue.
LVB