Home > Uncategorized > Delphi compiler warning: Unit ‘x’ implicitly imported into package ‘y’

Delphi compiler warning: Unit ‘x’ implicitly imported into package ‘y’

The Delphi compiler warning "Unit ‘x’ implicitly imported into package ‘y’" means that a unit not explicitly listed in the contains clause of the package is being implicitly pulled into the package because it’s imported by some other unit that’s listed at the package’s contains clause.

This warning is aiding the program in avoiding to violate the rule that a unit may not reside in more than one related package. Ignoring it will cause the unit to be put into the package which may cause errors when you try to use the related packages in some application project.

One can explicitly list the named unit in the contains clause of the package to avoid the warning (can right click a package file in Delphi and select to view its source or edit it visually via the package editor), or can have the package explicitly use some other package where the unit is being explicitly included.

Logging this here for reference since the respective help text of Delphi (reading it from a printout) was written in a bit cryptic way last time I had checked (long time ago that is :-).

Advertisements
Categories: Uncategorized Tags:
  1. Frankie Espinoza
    2010/10/19 at 22:00

    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
    Thank You
    http://frankieespinoza.weebly.com/

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: