FPC message: Can not find unit/fr

From Free Pascal wiki
Jump to navigationJump to search

Deutsch (de) English (en) français (fr) magyar (hu)

General hints

Example:

 unit1.pas(40,42) Fatal: Can't find unit forms

The compiler didn't find 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.

Can't find unit interfaces

The 'interfaces' unit is the part of the LCL. You must use it at least once in your program to link in the LCL interface (the platform dependent part of the LCL. For instance gtk or win32). You see this error, if

  • Make sure the project uses the LCL package. See Project -> Project Inspector -> Required Packages. If there is no LCL click on the 'Add' button and then 'New Requirement', select the LCL and press Ok.
  • Make sure the unit is part of the project. Use Project -> Add editor file to project.
  • Make sure the 'interfaces.ppu' is in the unit path, and the 'interfaces.pp' is not in the unit path. And that you only have one 'interfaces.ppu' in the unit path. You can see the unit path in Source Editor -> Right mouse click -> Popup Menu -> Unit Info -> Unit Paths.
  • Make sure your compiled LCL fits to the installed compiler. For example if you installed a new compiler, then the LCL must be rebuilt (for example the interfaces.ppu must be rebuilt).

Can't find unit LResources

Can be solved by doing "Tools/Build Lazarus"

Detailed description about this topic

There is a detailed page about searching units here: Unit not found - How to find units