Recent

Author Topic: Strange behaviour  (Read 1319 times)

calebs

  • Full Member
  • ***
  • Posts: 215
Strange behaviour
« on: August 03, 2025, 05:07:56 pm »
hello all.
I have this problem or a nuisance.
I write a program with graphic interface (in win x64) and compile and run it and all went well.
Then do a little modification (for example, comment a procedure) to avoid run and proceed to compile and run again.
Lazarus compiles well (all messages from messages windows are normal), build run like it should but when program is executed the executed is the prior version (the one without the commented procedure or modification).
Tried to build, clean and build, delete temporary lib folder, deleting the executable and build again but it seems to happen the same.
Sometimes i do a trivial modification (add a space in editor before a line) then proceed to hit save button, compile and it compiles and run as expected.
It seems that is storing previous builded executable somewhere to build the new.
Im using lazarus 4.3 (fixes) with fpc 3.2.2 installed with fpcupdeluxe but this also happened with 4.1 and i think that with 3.9 also.
Do you have any hint for this problem?
It doesn't happen all the time, just sometimes.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12180
  • Debugger - SynEdit - and more
    • wiki
Re: Strange behaviour
« Reply #1 on: August 03, 2025, 05:35:30 pm »
Does it happen in any and all of the units? Or only when changes are in certain units?

It could be that some of the ppu are not recreated...

This could happen if
- they were build with -Ur
- they are not listed in the "project inspector" or their "package window". (in combination with other conditions)
- if you include them from other folders with custom path settings (again in combination with other conditions)

You can search for the ppu, and check the date on it. (and also make sure there is only one ppu for each unit.



Other factor that can lead to incorrect /skipped recompilation:
- include files
- generics (at least with some version of fpc / only seen that once or twice...) / for those the "build" option of the IDE usually helps.

calebs

  • Full Member
  • ***
  • Posts: 215
Re: Strange behaviour
« Reply #2 on: August 09, 2025, 05:59:44 pm »
thanks martin i will look it up. I forgot to tell, this is a set of programs (a "system" like we call it here in argentina to programs that are for account/pos/sale/etc) that i'm programming from when lazarus was 0.9.x in windows x86/x64 and debian linux x86/x64. I've programming this "system" from that time. Sometimes i think that the source of some of the problems that i have could be that, many versions of lazarus used to program the same set of applications. I don't think that the problems came from the .pas files but from other files that are in the project (lpi, lps, res , flm, lpr, ppus, etc). I've recall that sometime when upgrade lazarus version had to edit some of those files manually because lazarus won't open the project at all.
Netherveles, lazarus is very mature and i am very satisfied with it but sometimes i encounter this problems that puzzles me but luckly the community is always giving a hand for that.
Thanks!

jamie

  • Hero Member
  • *****
  • Posts: 7589
Re: Strange behaviour
« Reply #3 on: August 09, 2025, 06:46:26 pm »
You need to check the compile date on the EXE file when you see this, determine if its current or the same old EXE file beforehand.

 Is it possible if you were to save a changed Editor file before compiling, does the IDE get mixed up and not actually generate a new EXE before no changes are detected?

 Jamie.
The only true wisdom is knowing you know nothing

n7800

  • Hero Member
  • *****
  • Posts: 644
  • Lazarus IDE contributor
    • GitLab profile
Re: Strange behaviour
« Reply #4 on: August 09, 2025, 09:54:10 pm »
Make sure you are editing the right file. The path to it is written in the Source Editor status bar.

Sometimes, using the search in files, I accidentally opened a backup copy that Lazarus creates by default in the project's "backup" subfolder. Of course, the changes were not applied, and for a long time I could not understand why...

n7800

  • Hero Member
  • *****
  • Posts: 644
  • Lazarus IDE contributor
    • GitLab profile
Re: Strange behaviour
« Reply #5 on: August 09, 2025, 10:02:05 pm »
Other factor that can lead to incorrect /skipped recompilation:
- include files

By the way, I sometimes have problems with included files ("*.inc"). Under certain conditions, changes to them are not detected, and I have to manually change the unit that uses it (just to update the modification date).

440bx

  • Hero Member
  • *****
  • Posts: 6130
Re: Strange behaviour
« Reply #6 on: August 09, 2025, 10:52:37 pm »
By the way, I sometimes have problems with included files ("*.inc"). Under certain conditions, changes to them are not detected, and I have to manually change the unit that uses it (just to update the modification date).
I have experienced that problem and don't know what causes it.

As far as what the OP mentions that the fresh compile does not seem to include the changes, the solution I've found to that problem is to go into Lazarus' backup directory and delete all the backup source files it keeps.  I quit Lazarus before I do that to ensure I may not be deleting something it expects to be there at the time.  After the backup files are deleted (using command line or Windows Explorer), I restart Lazarus, ensure the changed files still include the changes and re-build.  So far, that has always worked.

Fortunately, the problem is rare.

HTH.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

jamie

  • Hero Member
  • *****
  • Posts: 7589
Re: Strange behaviour
« Reply #7 on: August 09, 2025, 11:15:19 pm »
One of the issues I found long ago and I voiced my opinion about it, if you make changes to the sources while let's say a debug session is running and save the changes, dump the debug session and then run again, you may see the old one that was there before because it was not considered change.

 I noticed this long ago but I try to make it a happen of not making changes while a debug session is running or at least don't save it yet.

 I normally compile before I save and normally a successful compile automatically saves the changes.


The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018