Search code examples
delphidelphi-xe2

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!


Solution

  • 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.