Recent

Author Topic: "PPU file isn't found by the compiler" error  (Read 240 times)

Dave75

  • Newbie
  • Posts: 5
"PPU file isn't found by the compiler" error
« on: February 16, 2026, 06:51:47 pm »

Hi all,

I'm brand new in Lazarus.
I've a fresh installation in Debian 13 but I've a problem getting the compiled binary.
While I have no problem in Compiling and Running an application, I go the following error when I try to create a binary file of the application:

Code: Text  [Select][+][-]
  1. "Build File /home/davide/Progetti_FP/Prova/unit1.pas: Codice di uscita 1, Errori: 1
  2. Copyright (c) 1993-2021 by Florian Klaempfl and others
  3. Target OS: Linux for x86-64
  4. unit1.pas(8,22) Error: Impossibile trovare Forms usato da Unit1, ppu=/home/davide/.lazarus/lib/LCLBase/units/x86_64-linux/forms.ppu incompatibile, pacchetto LCLBase.
  5. You tried to use a unit of which the PPU file isn't found by the compiler. Check your configuration file for the unit paths."
  6.  

Note that I've got the problem even with a blank brand new application with just a form in it (the basic code proposed by Lazarus when a new application project is created), like the following:

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.   private
  13.  
  14.   public
  15.  
  16.   end;
  17.  
  18. var
  19.   Form1: TForm1;
  20.  
  21. implementation
  22.  
  23. {$R *.lfm}
  24.  
  25. end.  

Actually the file mentioned exists:
ppu=/home/davide/.lazarus/lib/LCLBase/units/x86_64-linux/forms.ppu

Thanks to anyone who may have some hints.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • Debugger - SynEdit - and more
    • wiki
Re: "PPU file isn't found by the compiler" error
« Reply #1 on: February 16, 2026, 07:20:21 pm »
Maybe a problem after updating Lazarus....

Try: Menu > Tools > Configure Build Lazarus
 => Select "clean all" (radio-box)
 => Press "build" (button)

You do not need to restart (you can, but you do not need).

After that, try building your app again.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • Debugger - SynEdit - and more
    • wiki
Re: "PPU file isn't found by the compiler" error
« Reply #2 on: February 16, 2026, 07:24:58 pm »
Actually the file mentioned exists:
ppu=/home/davide/.lazarus/lib/LCLBase/units/x86_64-linux/forms.ppu

Yes the file exists, but the error says "incompatibile" => e.g. build with a different version of FPC. (or diff settings)

In rare cases the IDE does not detect this, and then you get this error. Normally the IDE should detect this, and then the IDE would rebuild it automatically.

Rebuild Lazarus with "clean all" is just a way to force rebuilding that unit too.

Dave75

  • Newbie
  • Posts: 5
Re: "PPU file isn't found by the compiler" error
« Reply #3 on: February 16, 2026, 08:10:56 pm »
Thank you Martin_fr

I've tried what you've suggested. It worked for few minutes succesfully (with some warnings, but I guess it's normal). At the end Lazarus closed and restarted.
In attachment the "build Lazarus" window before clicking on "Build" (Costruisci) button.
I've tried again with the code posted before (an empty form): no problems in "Running" the code, the form appears, but again when I ask to build the binary the same error comes out.




Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • Debugger - SynEdit - and more
    • wiki
Re: "PPU file isn't found by the compiler" error
« Reply #4 on: February 16, 2026, 08:37:18 pm »
I've tried again with the code posted before (an empty form): no problems in "Running" the code, the form appears, but again when I ask to build the binary the same error comes out.

"running" <> "build the binary"
Strictly speaking, when you "run" there is a binary being build too.

Just to be sure I understand,

- Menu: Project > New Project > Application
- Menu: Run > Run  (or just F9 / or the green arrow button)
=> app starts running from the IDE
=> If you added code source editor shows some blue dots on the left side
=> the "pause" and "stop" button in the toolbar become active

But
- Menu: Run > Build
=> and you get the error?


Or do you mean "lazbuild"?
« Last Edit: February 16, 2026, 08:45:49 pm by Martin_fr »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • Debugger - SynEdit - and more
    • wiki
Re: "PPU file isn't found by the compiler" error
« Reply #5 on: February 16, 2026, 08:49:04 pm »
I just noted:

Quote
"Build File

If you selected "build file" that will not generate the binary (though the error message is not what I would expect at all).

"build file" will compile/build the current file. But "unit1" is not a file that generates an executable.

There is a 2nd file "project1.lpr" and that can generate the executable.
If you just go for "run > build" then the IDE will build that.

You can see this 2nd file by: Menu: project > view project source

Dave75

  • Newbie
  • Posts: 5
Re: "PPU file isn't found by the compiler" error
« Reply #6 on: February 16, 2026, 08:52:57 pm »
yes, exactly, you understand correctly, this is what is happening. I'm a bit puzzled ... I cannot understand how it can works when I ask "Run / Run" but it doesn't when I ask "Run / Build"  %)

In attachment after asking "Run / Run".

Dave75

  • Newbie
  • Posts: 5
Re: "PPU file isn't found by the compiler" error
« Reply #7 on: February 16, 2026, 08:56:31 pm »

There is a 2nd file "project1.lpr" and that can generate the executable.
If you just go for "run > build" then the IDE will build that.

You can see this 2nd file by: Menu: project > view project source

Just tried this as well ... not exactly the same error (now pointing to "Interfaces" instead of "Form"), but still an error of missing / incompatible file (see attachment).

I'm really puzzled.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • Debugger - SynEdit - and more
    • wiki
Re: "PPU file isn't found by the compiler" error
« Reply #8 on: February 16, 2026, 09:21:35 pm »

There is a 2nd file "project1.lpr" and that can generate the executable.
If you just go for "run > build" then the IDE will build that.

You can see this 2nd file by: Menu: project > view project source

Just tried this as well ... not exactly the same error (now pointing to "Interfaces" instead of "Form"), but still an error of missing / incompatible file (see attachment).

That was with

Menu: Run > Build file

or with
Menu: Run > Build

?

"Build file" does seem to have a problem. I don't know exactly how it should be used (I don't use it myself). Someone else needs to look into that.

But "Build"  (the 2nd entry in the "Run" menu) should work.

Dave75

  • Newbie
  • Posts: 5
Re: "PPU file isn't found by the compiler" error
« Reply #9 on: February 16, 2026, 09:27:08 pm »

"Build file" does seem to have a problem. I don't know exactly how it should be used (I don't use it myself). Someone else needs to look into that.

But "Build"  (the 2nd entry in the "Run" menu) should work.

Defenitely "Build" works!  ::) ... I was using "Build file"    :(

Thanks Martin_fr! it's solved!
« Last Edit: February 16, 2026, 09:28:43 pm by Dave75 »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • Debugger - SynEdit - and more
    • wiki
Re: "PPU file isn't found by the compiler" error
« Reply #10 on: February 16, 2026, 09:29:59 pm »
Afaik (but I haven't looked at it in a long time)

"Build file" is to check the current file for compile errors. But given that it fails even that, I don't know...
Not sure how it needs to be set up.

 

TinyPortal © 2005-2018