0

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!

4

1 回答 1

1

也许链接依赖项存储在构建 .obj 文件中。VS2008 没有“看到”重建它的必要性,因为它的源代码和构建选项都没有改变。链接旧依赖项时,链接失败。

我认为混合 2 个 VS 构建是个坏主意。如果您需要两种解决方案,则在从一种解决方案更改为另一种解决方案时应始终进行重建。

于 2010-06-02T13:12:56.687 回答