Menu ▾ ▴

#99 `GX_GenericUtils.pas` fails to build in Delphi 2007 because it uses unit `UITypes`

Closed
closed-fixed
nobody
None
5
2018-12-01
2018-11-27
No

From https://github.com/jpluimers/GExperts/issues/22

SVN Patch https://gist.github.com/jpluimers/b70a5d48c3eb9302762ad1b6644a8a81

Not yet applied by Thomas

Description

https://github.com/jpluimers/GExperts/blame/master/Source/Utils/GX_GenericUtils.pas via https://sourceforge.net/p/gexperts/code/2200/ added unit UITypes to the interface uses list of GX_GenericUtils which causes the build to fail as it was only added in Delphi XE2, so it is not available in Delphi XE or lower.

This fails in the Delphi 2007 based standalone projects.

A unit alias might solve this, but I need to investigate if this always works.

Comments

Unit aliases should work, as for the Delphi 1 -> Delphi 2 migrations, these aliases were used where multiple units pointed to the same one:

WinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE

See https://stackoverflow.com/questions/284091/wintypes-dcu-not-found-and-code-completion-stops-working/284290#284290

This means a unit alias should work.

Adding this after each <DCC_UNIT_PLATFORM>False</DCC_UNIT_PLATFORM>
line in the below Delphi 2007 projects should work:

    <DCC_UnitAlias>UITypes=Types</DCC_UnitAlias>

If it fails, then try this one:

    <DCC_UnitAlias>Actions=ActnList;ImageList=ImgList;UITypes=Types</DCC_UnitAlias>

Based on https://github.com/jpluimers/GExperts/commit/790c84b79c1aaeb6420388d3c919dcd42ed6aa83

Affected .dproj files:

Not needed:

Discussion

  • Thomas Mueller

    Thomas Mueller - 2018-11-28
    • status: open --> closed-fixed
     
  • Thomas Mueller

    Thomas Mueller - 2018-11-28

    I'm not sure why this unit was there in the first place. Removed it and it still compiled in Delphi 2007 and 10.3. Maybe it will fail in other versions. We'll see.

     
  • Thomas Mueller

    Thomas Mueller - 2018-12-01

    The IDE only adds units to the uses clause for forms and frames, not for plain units, so this should be fine.

     

Log in to post a comment.