I am updating our projects from XE7 to XE8. For the time being they will still need to work with XE7, so a few conditionals are required. For example, ImageList has changed units, so Vcl.ImgList is Syste.ImageList in XE8. To make it work on both Delphi versions the uses clause looks something like this:
uses
System.SysUtils, System.Classes, Vcl.Controls
{$IF CompilerVersion >= 29.0}
,System.ImageList
{$else}
,Vcl.ImgList
{$endif}
,cxGraphics;
Sometimes this works fine. However, quite often Delphi automatically re-adds the System.Imagelist unit even though it is already there, albeit in a conditional e.g.
uses
System.SysUtils, System.Classes, Vcl.Controls
{$IF CompilerVersion >= 29.0}
,System.ImageList
{$else}
,Vcl.ImgList
{$endif}
,cxGraphics, System.ImageList;
When this is compiled, XE8 complains.
[dcc32 Error] dmImagesU.pas(13): E2004 Identifier redeclared: 'System.ImageList'
a) Why does Delphi add the unit? b) Anybody know a workaround?