Lag in detect change in included files with $INCLUDE lazarus / 21-General ---------------------------------------------------------------------- alantelles · 2021-01-24 19:32 Hello, y'all. Many times, when I make changes to included sources and compile program the changes are not "taken account". The program is compiled without the changes I've done. Only after some time or some random "close-open" Lazarus the program is rightfully compiled. There is a logic in this behaviour or something I should have done that I didn't? Edit: FPC 3.2.0, Lazarus 2.0.10, however it happened also in FPC 3.0.4 with Lazarus 2.0.6 ---------------------------------------------------------------------- jamie · 2021-01-24 20:06 did you try "Clean Up and Build all " ? ---------------------------------------------------------------------- MarkMLl · 2021-01-24 20:41 OP: please tell us EXACTLY what version of compiler etc. you're using. That would be important under normal circumstances, but in this case you might be looking at a recently-introduced compiler bug. Using FPC 3.2.0 and Lazarus 2.1.0 on Linux x86_64 I think I've been seeing something comparable. Using this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program PythonDemo; {$mode objfpc}{$H+} { define DYNAMIC }{$define PYTHON2 } ... uses  {$IFDEF UNIX}  cthreads,  {$ENDIF}  Classes,{$ifdef DYNAMIC }  python_dynamic;                       (* "Python" is a shared-library object  *){$note ===== Intending to link dynamically ===== }{$else          }  python;                               (* "Python" is a unit file              *){$note ===== Intending to link statically ===== }{$endif DYNAMIC }...  if I change the define DYNAMIC state I see the main unit (excerpted above) recompile, but there appears to be no change of what file is actually linked... Lazarus's "Build all" doesn't fix it, it's necessary to do a "Clean directory". I've not yet tried to work through older versions. MarkMLl ---------------------------------------------------------------------- alantelles · 2021-01-25 11:26 Quote from: MarkMLl on January 24, 2021, 09:41:56 pmOP: please tell us EXACTLY what version of compiler etc. you're using. That would be important under normal circumstances, but in this case you might be looking at a recently-introduced compiler bug. Using FPC 3.2.0 and Lazarus 2.1.0 on Linux x86_64 I think I've been seeing something comparable. Using this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program PythonDemo; {$mode objfpc}{$H+} { define DYNAMIC }{$define PYTHON2 } ... uses  {$IFDEF UNIX}  cthreads,  {$ENDIF}  Classes,{$ifdef DYNAMIC }  python_dynamic;                       (* "Python" is a shared-library object  *){$note ===== Intending to link dynamically ===== }{$else          }  python;                               (* "Python" is a unit file              *){$note ===== Intending to link statically ===== }{$endif DYNAMIC }...  if I change the define DYNAMIC state I see the main unit (excerpted above) recompile, but there appears to be no change of what file is actually linked... Lazarus's "Build all" doesn't fix it, it's necessary to do a "Clean directory". I've not yet tried to work through older versions. MarkMLl Edited to tell compiler version ---------------------------------------------------------------------- MarkMLl · 2021-01-25 11:33 Could you post a simple test project which demonstrates the problem? MarkMLl ---------------------------------------------------------------------- alantelles · 2021-01-25 18:51 I think it would not be able to reproduce because i think it's a "progressive" problem. As you use more included files the issue appears. It didn't happen until I have some more included files. There would be a lot of steps to reproduce in my project however, if you're realy interested I can leave it here ---------------------------------------------------------------------- MarkMLl · 2021-01-25 19:23 I'll try to take a bit of a look at it myself in the morning, and will report back. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2021-01-31 15:04 My apologies for the delay looking at this. I've just been tinkering with simple include and unit files in the same directory using the attached test files without finding anything untoward. @alantelles Please could you see if you can duplicate your problem using some variant of these, and if not I think we could usefully start looking at the unitpath directive etc. MarkMLl