HomeDelphiDelphi Error – E2220 Never-build package ‘%s’ requires always-build package ‘%s’

Delphi Error – E2220 Never-build package ‘%s’ requires always-build package ‘%s’

Delphi Compiler Error

E2220 Never-build package ‘%s’ requires always-build package ‘%s’

Reason for the Error & Solution

You are attempting to create a no-build package which requires an always-build package. Since the interface of an always-build package can change at anytime, and since giving the no-build flag instructs the compiler to assume that a package is up-to-date, each no-build package can only require other packages that are also marked no-build.

package Base;
end.

(*$IMPLICITBUILD OFF*)
package NoBuild;
  requires Base;
end.

In this example, the NoBuild package requires a package which was compiled in the always-build compiler state.

(*$IMPLICITBUILD OFF*)
package Base;
end.

(*$IMPLICITBUILD OFF*)
package NoBuild;
  requires Base;
end.

The solution used in this example was to turn Base into a never-build package. Another viable option would have been to remove the (*$IMPLICITBUILD OFF*) from the NoBuild package, thereby turning it into an always-build package.

See Also

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...