[Interest] link failure due to duplicate resources with VS2012 / Qt4.8.4

Hamish Moffatt hamish at risingsoftware.com
Wed Feb 6 07:30:15 CET 2013


Hi,

We're building successfully with Qt 4.8.4 on VS2008 and I'm trying to 
upgrade to 2012. However any project of ours which specifies Win32 
resources is failing to link with duplicate resource errors.

Here's a trivial qmake project which I've called linktest.pro:

TEMPLATE = app
TARGET = linktest
VERSION = 5.0.0

If I build this with "qmake -spec win32-msvc2012 -tp vc", 
linktest_resource.rc is generated including the 5.0.0.0 version definition.

When I now compile it with "msbuild /p:PlatformToolset=v110" (or in the 
IDE), the link fails with

CVTRES : fatal error CVT1100: duplicate resource.  type:VERSION, name:1, 
language:0x0409 [C:\dev\rising_cpp\projects\linkte st\linktest.vcxproj]
LINK : fatal error LNK1123: failure during conversion to COFF: file 
invalid or corrupt [C:\dev\rising_cpp\projects\linktest \linktest.vcxproj]


The generated linktest.vcxproj file contains:

   <ItemGroup>
     <CustomBuild Include="debug\linktest_resource.res">
       <ExcludedFromBuild 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
     </CustomBuild>
     <CustomBuild Include="release\linktest_resource.res">
       <ExcludedFromBuild 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
     </CustomBuild>
   </ItemGroup>

If I comment out either of the two CustomBuild nodes, the project links. 
It seems the two clauses are not mutually exclusive as they are supposed 
to be.

The IDE shows a red mark (disabled?) against one of the two entries for 
the generated resource file in the Solution Explorer though.

Has anyone else experienced this and found a solution? Can anyone else 
reproduce it with my project file above?


thanks
Hamish




More information about the Interest mailing list