Question

Error E2200 is to be expected if you try to put the same unit X into two different named packages, Y and Z. It is NOT expected when the name of the package is the same on both the left and the right side of the error message. It is also odd that the above spurious or confusing E2200 is most often accompanied by E2213, bad packaged unit format.

I see intermittent compiler errors in this form, which was clearly intended to warn users that they are putting the same unit into two different packages, yet it sometimes occurs that it gives you this message with the same package basename on the left and on the right, in the case below, note the Jacob-Two-Two error message. You can't put that in ZZLibD16, because it's already in ZZLibD16. This error is confusing to users, including me, and yet I've seen this many times, and already worked out how to get around it.

[DCC Error] ZZLibD16.dpk(82): E2200 Package 'ZZLibD16' already contains unit 'ZZChartComboBox'
[DCC Error] ZZLibD16.dpk(83): E2200 Package 'ZZLibD16' already contains unit 'ZZComboBox'
[DCC Error] ZZLibD16.dpk(84): E2200 Package 'ZZLibD16' already contains unit 'ZZDBComboBox'
[DCC Error] ZZLibD16.dpk(85): E2200 Package 'ZZLibD16' already contains unit 'ZZDBGrid'
[DCC Error] ZZLibD16.dpk(86): E2200 Package 'ZZLibD16' already contains unit 'ZZQuery'
[DCC Error] ZZLibD16.dpk(87): E2200 Package 'ZZLibD16' already contains unit 'ZZTable'
[DCC Error] ZZLibD16.dpk(88): E2200 Package 'ZZLibD16' already contains unit  'ZZTrackBar'
[DCC Fatal Error] RSLibD16.dpk(308): E2213 Bad packaged unit format: ZZSomething.dcp.ZZUnitX - Expected version: 23.0, Windows Unicode(x86) Found version: 0.0, Unk(x86)

I believe that the normal cause of this strange "You can't put X in Y" where error is some "bad package hygiene" practice, and I have suspicions about what the fixes are, but I wonder if anyone has researched this and can definitively answer what one should do.

I normally try to resolve it by looking for duplicate copies of DCP files and cleaning up the duplicate or extra copies. I am aware of that part of this question. What I'm wondering is, is there something you can do to avoid the IDE breaking your computer and generating bad DCUs? For example, I have long suspected that by avoiding having packages and projects have any paths common to their input (search) and output (DCU output and DCP output) paths, one can avoid this problem. Is that the case? If not, what is the way to prevent such problems? What organizational rules in your project search and library search paths will avoid this problem?

In some cases the following is enough: Right click on every project in your group and clean. Now build again, problem goes away, for a while, only to return. In other cases, I have more complex sets of packages to build, and the only workable workaround is NOT to build from the IDE at all, but rather to build from msbuild from a batch file. In yet other cases, I find it helps to change all packages from "Rebuild as needed" to "Explicit rebuild". I am in fact, not able to understand or really "solve" or prevent the problem, and only able to work around it by various kludges. Has anyone got a better understanding, who can explain the cause and solution of such package strange problems, including the "bad packaged unit format"?

In the question above, I am specifically using Delphi XE2, but I think that a similar answer should be applicable for all versions of Delphi from about 2010 and up.

No correct solution

OTHER TIPS

Go to "C:\Users\Public\Documents\Embarcadero\Studio", Rename folder "21.0" to "21.0_" and restart Delphi and Give a Try

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top