View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008386CMakeCMakepublic2009-01-15 18:022011-06-06 18:25
ReporterTed Berg 
Assigned ToDavid Cole 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in VersionCMake 2.8.4 
Summary0008386: duplicate manifest entries on link
DescriptionAttached test case builds a trivial DLL which includes a manifest file as part of the libraries resource file. Linking fails with the following error:
CVTRES : fatal error CVT1100: duplicate resource. type:MANIFEST, name:2, language:0x0409
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
FINAL LINK failed. with 1123

Some way to prevent CMake from automatically adding a manifest would be helpful.

It appears that the manifest tool (mt.exe) allows for multiple manifests. I don't know enough about this tool/process to say, but there may be a more general case for this particular issue.
TagsNo tags attached.
Attached Fileszip file icon testcase.zip [^] (2,051 bytes) 2009-01-15 18:02

 Relationships
related to 0010704closedDavid Cole don't GenerateManifest flag (/Manifest:NO) doesn't work with VS 2010 

  Notes
(0025327)
David Cole (manager)
2011-02-08 11:46

You can avoid the manifest automatically added by the linker by passing "/MANIFEST:NO" with the link flags.

In your CMakeLists.txt file:

  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")

Alternatively, you can use the "mt.exe" tool to merge your own manifest.xml file with the automatically generated one as a post-build step.

I am trying this out with VS 2008 and VS 2010 right now, and it works as I expect it to (avoiding building in a manifest) with VS 2008. But I'm having trouble getting VS 2010 to honor the "/MANIFEST:NO" flag. I'll report back again once I've figured that out...
(0025330)
David Cole (manager)
2011-02-08 12:18

When the related issue 0010704 is fixed, then you will be able to use the technique in my previous note with the Visual Studio 2010 generator as well.
(0025331)
David Cole (manager)
2011-02-08 12:19

One final workaround, I'll mention. You can simply re-number the manifest resource in your rc file (use a 3 instead of a 2) and you'll get 2 manifest resources in the final dll. (Also avoids the error you're seeing.)
(0025332)
David Cole (manager)
2011-02-08 12:20
edited on: 2011-02-08 12:20

Resolving this as "no change required" since there are several ways in which you can work-around this problem, including setting the flags properly so that the linker does not automatically generate a manifest resource.

Feel free to re-open if you think there's still a problem here... Or ask for advice on the CMake mailing list. Many more eyes are on the mailing list than on this bug tracker.

(0026706)
David Cole (manager)
2011-06-06 18:25

Closing resolved issues that have not been updated in more than 3 months.

 Issue History
Date Modified Username Field Change
2009-01-15 18:02 Ted Berg New Issue
2009-01-15 18:02 Ted Berg File Added: testcase.zip
2009-01-15 18:41 Bill Hoffman Status new => assigned
2009-01-15 18:41 Bill Hoffman Assigned To => David Cole
2011-02-08 11:46 David Cole Note Added: 0025327
2011-02-08 12:17 David Cole Relationship added related to 0010704
2011-02-08 12:18 David Cole Note Added: 0025330
2011-02-08 12:19 David Cole Note Added: 0025331
2011-02-08 12:20 David Cole Note Added: 0025332
2011-02-08 12:20 David Cole Status assigned => resolved
2011-02-08 12:20 David Cole Fixed in Version => CMake 2.8.4
2011-02-08 12:20 David Cole Resolution open => no change required
2011-02-08 12:20 David Cole Note Edited: 0025332
2011-06-06 18:25 David Cole Status resolved => closed
2011-06-06 18:25 David Cole Note Added: 0026706


Copyright © 2000 - 2018 MantisBT Team