views:

63

answers:

1

I have VS2005 and VS2008 installed on the same machine. I also have a common codebase that I build using both '05 and '08. For this purpose, I have 2 VC projects.. A '08 project called XYZ_2008.vcproj and a '05 project called XYZ_2005.vcproj, and the corresponding 2 slns as well. Both projects output dlls, libs and pdbs to the same output directory (all with appropriate _2005 and _2008 suffixes).

Assuming that I am starting from a clean state, I first open XYZ_2005.sln (containing XYZ_2005.vcproj) in VS2005 and build it successfully. Then I close VS2005.

Next, I open XYZ_2008.sln (containing XYZ_2008.vcproj) and build (not rebuild) it. At this point, I get an error saying:

LINK : fatal error LNK1104: cannot open file 'mfc80u.lib'

If now I rebuild the '08 solution, the error goes away and the build succeeds. The build also succeeds if I directly do a rebuild instead of a build for the '08 sln.

In spite of everything being separate, the VS08 build seems to be picking up a MFC8 file (from VS05) instead of a MFC9 file.

Can somebody please help out with this issue?

Thanks in advance!

A: 

Maybe the link dependency is stored in a build .obj file. VS2008 does not "see" the need for rebuilding it, since neither its source nor its build options are altered. When linking the old dependency is used and the linking fails.

I think its a bad idea to mix up 2 VS Builds. If you need both Solutions, you should always do a rebuild when changing from one to the other solution.

Franz Hirschbeck