[Lazarus] Strange problem compiling IDE

Martin Frb lazarus at mfriebe.de
Tue Mar 28 19:56:37 CEST 2017


On 28/03/2017 11:23, Giuliano Colla via Lazarus wrote:
> Il 26/03/2017 23:11, C Western via Lazarus ha scritto:
>> Expr.pas(78,12) Fatal: Can't find unit Expr used by FormGrid
>
> I believe that many problems of this kind could be solved at the root 
> if the fpc error message was not as misleading as it is currently.
>
> The error message lets you believe that it didn't find an Expr.pas or 
> an Expr.ppu, while the actual problem was that it found an 
> invalid/conflicting .ppu.
>
> Two different messages, one telling "can't find unit xxx" and another 
> telling "unit xxx invalid ppu" would save a lot of troubles and lead 
> you to quickly find the reason.

Actually they are both there.

"checksum changed for spe.ppu" was the first error. That is exactly what 
happens.

You have to think about how fpc is called.

1) the rtl and/or packages where build earlier. fpc is called with a 
path to the ppu, but fpc is not given the path to the pas files

2) when the package with Expr was build, fpc had a path that saw the fpc 
version of spe. So Expr.ppu contains the checksum for that ppu.

3) At some point the other spe was build

4)
And now - building yet anouther package - fpc is called with NO path to 
any of the pas files (Expr / spe), but only the ppu.

some unit needs to be compiled that "uses Expr".

fpc finds Expr.ppu
Afaik it verifies that this is still valid, by checking if units used by 
Expr.ppu have still the same checksum.

fpc stops when it finds the first spe.ppu / so fpc is unaware that there 
is another.
The checksum is wrong.

So it tells you that. (It does not say why the checksum changed, because 
it does not know)
It also tells you that it wants to rebuild Expr.pas
And it fails to do that. (because it was not give the path to the source)

----
This is basically because the build is divided into package. When 
building one package, fpc has very little info what happened in packages 
build before




More information about the Lazarus mailing list