Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DCC Hint: H2161 Warning: Duplicate resource: Type 24 (user-defined), ID 1; File resource ... kept; file ...\WindowsXP.res resource discarded

Get the following error while linking my project in Delphi XE2. Recreating of .dproj file doesn't help.

[DCC Hint] H2161 Warning: Duplicate resource: Type 24 (user-defined), ID 1; File resource <filename>.res kept; file c:\program files\embarcadero\rad studio\9.0\lib\Win32\release\WindowsXP.res resource discarded.

How to fix it? Thanks for the help!

like image 887
Dmitry Avatar asked Dec 21 '11 22:12

Dmitry


3 Answers

You've got more than one application manifest linked to the application. There can be only one and so some have to be discarded. Modern Delphi versions link a manifest by default based on the "Runtime themes" project option. You possibly have another manifest linked, perhaps dating from when you developed the project in an earlier version of Delphi. Are you using the TXPManifest component by any chance?

You can remove the manifest that you are explicitly linking. Or you can disable the runtime themes setting and retain the explicit manifest. That latter way you are in control of the manifest. Personally that is the way I do it because I do need to have control over precisely what goes in the manifest.

like image 75
David Heffernan Avatar answered Nov 11 '22 07:11

David Heffernan


I had the same problem, and arrived on this page via Google.

Removing XPMan from the uses-clause fixed it.

Found the culprit via "find in files" with search term "xpman". Thanks for Rob Kennedy for suggesting this in the comment to David's answer.

like image 45
Wouter van Nifterick Avatar answered Nov 11 '22 05:11

Wouter van Nifterick


Thanks for your help. For me, the following has helped:

{$ R * .RES} from project source removed
like image 5
Arian Avatar answered Nov 11 '22 05:11

Arian