I'm trying to install packages in Delphi 10.4.
When I try to build one of the packages, i get the familiar warning dialog that Delphi needs to do something:
Normally we don't care about this dialog.
- We don't know what they mean.
- We don't care.
- They don't make sense.
- It's just one of those things that you click OK on so that Delphi shuts up and just does what we tell it to.
Except in this case it's it's being a real pain
This time it says it needs to add getit.
:
Add getit.
getit contains implicit unit(s) Exceptions.
And so i think, "Whatever. I don't care what you need to work; just work.". And it adds it to my package:
Of course, there's no way a code unit from 10 years ago is using Getit of 10.4. I didn't even have 10.4 until
So how do i not gain a dependency on getit
. How do i stop Delphi from insisting that it needs getit anything?
CodePudding user response:
We don't know what they mean
Then I suggest you learn, as this is really important stuff to understand about how packages work.
there's no way a code unit from 10 years ago is using Getit of 10.4
True. But it likely does reference something that is not found in your project, but was found in the Getit package. Per https://en.delphipraxis.net/topic/3646-delphi-1041-upgrade:
When a unit is referenced by a package that is not contained in that package, it looks for other installed packages for this unit. In this case it found one in the getit package.
That is standard behavior since ages. Try compiling a package that uses VCL.Controls without mentioning anything in the requires clause. Delphi will suggest to add vcl.
Borland forced it upon me a few days ago
Borland has been out of the developer tool market since 2008, when they sold their tools to Embarcadero. And they didn't force you to upgrade, you chose to.
CodePudding user response:
The issue is that getit.dcp uses an internal unit called Exceptions
.
This unit isn't included anywhere with Delphi 10.4; it's just a secret unit internal to getit.dcp.
Which you think the compiler would continue to look inside getit.dcp for the Exceptions unit it needs.
Instead it seems happy to stumble across something completely unrelated that happens to have the same name.
- ideally the compiler would know to only look for things it needs in the location it knows it is
- and not pick up some chewing gum off the ground and start chewing it