[fpc-pascal] When are used units recompiled?

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Apr 5 13:27:04 CEST 2006

On 5 apr 2006, at 13:22, Tom Verhoeff wrote:

> In a programming course that I teach, some students are using  
> Lazarus+FPC
> instead of Delphi.  I made available two precompiled units, that  
> is, the
> *.ppu and *.o files.  However, when the students tried to compile  
> their
> programs using these units, the compiler complained that it could not
> find the *.pas files.  When compiling with -va (verbose all), it  
> became
> apparent that the compiler disliked something about the *.ppu files.
> (Sorry, I didn't get the exact message from the students.)

Without the exact message it's hard to tell.

> Can someone explain to me under what circumstances FPC will  
> (attempt to)
> recompile a unit for which *.ppu and *.o are already available?
> I couldn't find this in the documentation.

There are lots of possible reasons. The main ones are

1) sources with the same name as those used in a unit are found, and  
they are more recent than the ppu files
2) incompatible ppu files because the internal structure changed and  
the internal version number was increased

Cause 1) can be solved by compiling using the -Ur switch.

> Versions: I used FPC 2.0.1 to compile the units; the students
> used FPC 2.0.2 to compiler their programs.

It's quite possible that your 2.0.1 uses a different ppu format than  
the 2.0.2 release.


More information about the fpc-pascal mailing list