views:

15

answers:

1

Hi,

I'm working on a medium-sized project which uses qmake to generate Visual Studio 2005 project files. I'm trying to get it built under Visual Studio 2010 Ultimate. Since qmake doesn't support this IDE yet i had the provided conversion assistant convert my solution.

When trying to build I get the following error in one of the subprojects:
1>CVTRES : fatal error CVT1100: duplicate resource. type:VERSION, name:1, language:0x0407

After what Google's results told me it seems that this error is likely to occur when migrating to a newer version of Visual Studio but I don't know why and the hacks recommended there don't work for me.

What I already tried is to rename the ressources to random numbers, even a different "name" at every occurence of the version information. When I build the project again after reading the error and deleting the corresponding .RC-file it works once. But that's too much of a hack...

Any ideas anyone? Thanks in advance.

A: 

This is a stretch, but I had a similar problem under Visual Studio 2005. It might help, or be totally off base:

I was linking with a static library (.lib) that has its own version resource - very reasonable, it shows the library's version. On some stations, my app would link. On other stations, I'd get the same duplicate resource message you got.

It turned out to be related to a linker optimization setting: "Use Library Dependency Inputs" (UseLibraryDependencyInputs=), possibly combined with "Link Library Dependencies". When "Use Library Dependency Inputs" was enabled, the linker was being fed the .obj and .res files that were used to build the .lib, instead of just searching the .lib.

The problem is that you don't want the .lib's .res file as an input file to the linker. My project has its own version resource. If you bring in the .lib's resources, you now have two version resources, hence the error. If the linker simply searches the .lib, it has no reason to bring in the .lib's resource, and all is well.

My project's configuration didn't force the setting of "Use Library Dependency Inputs", it inherited it. On some stations, it inherited "No", and I could link. On some stations, it inherited "Yes", and we got the error.

If Visual Studio 2010 still has this setting, try forcing it off.

Makes sense, but playing with these settings doesn't change anything about my error.