Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2026-02

Lazarus 4.4 32 bit / windows 10: tens of annoying files (.ppu and .o) in the work directory

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

duilio foschi

the problem is stated in the subject:

when I compile my project, tens of files that belong to Lazarus core (I guess) are created in my work directory.

To say better, those object files are created only if I try to delete them. No objection (no pun intended): this is sound compiler policy.

But there must be a way to tell the compiler to create the compiled files in a folder other than the working directory

If I am not asking too much, I'd like to keep the final EXE in the working directory thou.

Please instruct

Thank you

Peppe

Reply by email

Michael Van Canneyt
to duilio foschi
duilio foschi wrote 15 lines
the problem is stated in the subject: when I compile my project, tens of files that belong to Lazarus core (I guess) are created in my work directory. To say better, those object files are created only if I try to delete them. No objection (no pun intended): this is sound compiler policy. But there must be a way to tell the compiler to create the compiled files in a folder other than the working directory If I am not asking too much, I'd like to keep the final EXE in the working directory thou. Please instruct

-FU tells the compiler where to write the unit .ppu and .o -ooutputfile tells the compiler where to write the binary.

Both can be set in the Lazarus project options dialog, under 'paths'.

Michael.

Reply by email

Martin Frb
to duilio foschi: the problem is stated in the subject: when I compile my project, tens of files that…
duilio foschi wrote 14 lines
the problem is stated in the subject: when I compile my project, tens of files that belong to Lazarus core (I guess) are created in my work directory. To say better, those object files are created only if I try to delete them. No objection (no pun intended): this is sound compiler policy. But there must be a way to tell the compiler to create the compiled files in a folder other than the working directory If I am not asking too much, I'd like to keep the final EXE in the working directory thou.

That should not happen.

1) Does it happen with a new project?

2) Menu: Project > Project Options
then page: "PATHS"
Do you have any values on that page?

Other than:
"Include files" = "$(ProjOutDir)"
"Unit output director" = something
"Target file name" ...

All others should be blank/empty.

Further if you have any custom complier options => there should be no -Fu

If you have them, remove them. If that breaks compilation, check which package the no longer found units are, and add the packages as requirements.

------------------
the "Project options" dialog has a "Show options" button at the bottom, press it.
Copy the settings that it shows.
Also copy what it shows in "inherited parameters"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20260208/26730381/attachment.htm>

Reply by email

duilio foschi
to Martin Frb

project -> compiler options -> paths

1. in the box 'Unit output directory (-FU)' I wrote c:\tmp
2. in the box 'Target file name (-o)' I wrote
c:\culpnapoli\webapp.exe

This produces exactly what I wanted:
1. files *.o and *.ppu into c:\tmp
2. final exe into c:\culpnapoli

I am happy.

Thank you

Peppe

Show quoted text 50 lines
On 08/02/2026 22:09, duilio foschi via lazarus wrote: the problem is stated in the subject: when I compile my project, tens of files that belong to Lazarus core (I guess) are created in my work directory. To say better, those object files are created only if I try to delete them. No objection (no pun intended): this is sound compiler policy. But there must be a way to tell the compiler to create the compiled files in a folder other than the working directory If I am not asking too much, I'd like to keep the final EXE in the working directory thou. That should not happen. 1) Does it happen with a new project? 2) Menu: Project > Project Options then page: "PATHS" Do you have any values on that page? Other than: "Include files" = "$(ProjOutDir)" "Unit output director" = something "Target file name" ... All others should be blank/empty. Further if you have any custom complier options => there should be no -Fu If you have them, remove them. If that breaks compilation, check which package the no longer found units are, and add the packages as requirements. ------------------ the "Project options" dialog has a "Show options" button at the bottom, press it. Copy the settings that it shows. Also copy what it shows in "inherited parameters" -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

Reply by email

Martin Frb
to duilio foschi
duilio foschi wrote 7 lines
project -> compiler options -> paths 1. in the box 'Unit output directory (-FU)' I wrote c:\tmp 2. in the box 'Target file name (-o)' I wrote c:\culpnapoli\webapp.exe

That should be fine.

But, if you get other ppu files => you do get them in c:\tmp ?

Then that usually means that you have somewhere hidden a -Fu (lower u) "other unit files".

Or you have (not tested, but maybe possible) in your source code ? uses Forms in 'c:\lazarus\lcl\forms.pas';? // or similar

when I compile my project, tens of files that belong to Lazarus core (I guess) are created in my work directory. To say better, those object files are created only if I try to delete them

That said, what exactly kind of files?

something.ppu ?
something.o ?
something.res
something.obj
something.lnk

And does "somethning" resemble the name of any lazarus file (like forms, classes, sysutils, ...)?

My answer was based on that you get (form as example / may be classes, or ...)
? forms.ppu and forms.o ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20260208/c7856191/attachment.htm>

Reply by email

Martin Frb
to Martin Frb
Martin Frb wrote 5 lines
But, if you get other ppu files => you do get them in c:\tmp ? Then that usually means that you have somewhere hidden a -Fu (lower u) "other unit files".

...

My answer was based on that you get (form as example / may be classes, or ...) ? forms.ppu and forms.o ?

It is also possible that you have *.pas files somewhere in your lazarus/fpc installations that where moved into the wrong folders (in folders that should only have ppu/o files).

You can compile with
? -va

copy => copy all and original messages
- give the exact name of one of the files that was created unexpected
- send the log file

You have my email address in the sender field. the mail list likely want accept the size of the full log.

Reply by email

duilio foschi
to Martin Frb

this is what is displayed with 'show options' from project -> project options -> compiler options -> paths

C:\lazarus\fpc\3.2.2\bin\i386-win32\fpc.exe
-MObjFPC
-Scghi
-O1
-gw3
-gl
-l
-vewnhibq
-FiC:\tmp
-Fic:\lazarus\lcl\include
-FuC:\lazarus\components\lazutils
-FuC:\lazarus\lcl
-FuC:\lazarus\lcl\interfaces\win32
-FuC:\lazarus\lcl\widgetset
-FuC:\lazarus\lcl\forms
-Fu.
-FUC:\tmp\
-FE.
-owebapp.exe

Everything works as I wished, with all the compiler stuff saved into folder c:\tmp and NO unwanted stuff in the working directory.

Case closed.

Thanks to everybody

Peppe

Show quoted text 32 lines
On 08/02/2026 23:10, Martin Frb via lazarus wrote: > > But, if you get other ppu files => you do get them in c:\tmp ? > > Then that usually means that you have somewhere hidden a -Fu (lower u) > "other unit files". ... > > My answer was based on that you get (form as example / may be classes, > or ...) > forms.ppu and forms.o ? It is also possible that you have *.pas files somewhere in your lazarus/fpc installations that where moved into the wrong folders (in folders that should only have ppu/o files). You can compile with -va copy => copy all and original messages - give the exact name of one of the files that was created unexpected - send the log file You have my email address in the sender field. the mail list likely want accept the size of the full log. -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

Reply by email

Martin Frb
to duilio foschi
duilio foschi wrote 31 lines
this is what is displayed with 'show options' from project -> project options -> compiler options -> paths C:\lazarus\fpc\3.2.2\bin\i386-win32\fpc.exe -MObjFPC -Scghi -O1 -gw3 -gl -l -vewnhibq -FiC:\tmp -Fic:\lazarus\lcl\include -FuC:\lazarus\components\lazutils -FuC:\lazarus\lcl -FuC:\lazarus\lcl\interfaces\win32 -FuC:\lazarus\lcl\widgetset -FuC:\lazarus\lcl\forms -Fu. -FUC:\tmp\ -FE. -owebapp.exe Everything works as I wished, with all the compiler stuff saved into folder c:\tmp and NO unwanted stuff in the working directory. Case closed. Thanks to everybody

I guess you want to rebuild LCL with debug info?
Or you try for some reason to disable the IDE package management?

The line -Fu? (lower u) in the above list shouldn't be there.

Instead you should have something like
-FuB:\lazarus_main\lcl\units\x86_64-win64\win32
-FuB:\lazarus_main\lcl\units\x86_64-win64
-FuB:\lazarus_main\components\lazutils\lib\x86_64-win64 ....

But then you need to apply debug settings to each package.

And you can do that within the project settings (so different for each project, and with build modes).
-> search the wiki for the "Additions and overrides" settings of the project.

----------------------------
Your settings can work. But they will cause you extra work, if you need something from yet another package =>? as you need to remove the package, and add the path.
Also if you remove the package, then code completion will not work well. But if you don't you get duplicate warnings.

The only case were you can't use the correct package system is if you need files from the "fpc" folder to be recompiled for debug (or other different settings).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20260209/767bc2a7/attachment.htm>

Reply by email