FPC message: Can not find unit
From Lazarus wiki
Jump to navigationJump to searchGeneral hints
Example:
unit1.pas(40,42) Fatal: Can't find unit forms
The compiler didn't found a compatible forms.ppu file nor a source file (forms.pp or forms.pas or forms.p).
The compiler searches in the unit path. The unit path is the sum of:
- the fpc.cfg file (linux, macosx, bsd: /etc/fpc.cfg)
- the Lazarus compiler options. See Project -> Compiler Options
- -> Paths -> Other unit files
- -> Inherited -> All inherited options -> unit path (if available)
Note: Even if there is a forms.ppu file in the unit path, the above message can appear, because FPC checks if the ppu file is valid (up to date). The .ppu file is valid, if all files it depends on are valid. If you install another FPC all .ppu files on your system become invalid and must be recompiled.