HI everyone. I'm having trouble compiling a project in XE. The project builds fine in XE2-XE6, and uses dotted unit names / namespaces. XE doesn't find a lot of the units, such as Vcl.Graphics, System.SysUtils, etc, since in XE they were not yet named with the prefixes, and so I thought I would try using unit aliases, "Vcl.Graphics=Graphics;Vcl.Forms=Forms;System.SysUtils=SysUtils", and so forth. This gets me a few compile steps further until I hit the error, "E2411 Unit ImgList in package vcl refers to unit Graphics which is not found in any package. Packaged units must refer only to packaged units". I can't make sense of that, I'm pretty certain Graphics.pas is in the VCL package! This occurs on a uses line, which uses only two units, "Vcl.Graphics, Vcl.Forms".

HI everyone. I'm having trouble compiling a project in XE. The project builds fine in XE2-XE6, and uses dotted unit names / namespaces. XE doesn't find a lot of the units, such as Vcl.Graphics, System.SysUtils, etc, since in XE they were not yet named with the prefixes, and so I thought I would try using unit aliases, "Vcl.Graphics=Graphics;Vcl.Forms=Forms;System.SysUtils=SysUtils", and so forth. This gets me a few compile steps further until I hit the error, "E2411 Unit ImgList in package vcl refers to unit Graphics which is not found in any package.  Packaged units must refer only to packaged units". I can't make sense of that, I'm pretty certain Graphics.pas is in the VCL package! This occurs on a uses line, which uses only two units, "Vcl.Graphics, Vcl.Forms".

I have a brand new installation of XE Update 1, plus the hotfix for QC 90864 (an error I also ran into.)

Any ideas? Is using unit aliases the right approach? I don't want to remove all my nicely scoped unit names - it was bad enough backporting this code to XE2 and having to lose TStringHelper ;)

Comments

  1. Daniela Osterhagen Hah, no worries. We all do it. I appreciate you suggesting something anyway!

    ReplyDelete
  2. Stefan Glienke Using -NS (namespace search path) gives "F1026: File not found 'System.SysUtils.dcu'". I've also experimented with -U (unit directories), -O (object directories) and -I (include directories) in various combinations, passing in the path to where SysUtils.pas lives. No luck.

    Do you have any suggestions?

    ReplyDelete
  3. Not to worry. I think my solution is to remove namespace prefixes altogether - I've found an automated command-line method, so I can do it just for building the XE & 2010 versions.

    ReplyDelete

Post a Comment