Recent

Author Topic: Inconsistent behaviour with nested .inc files  (Read 944 times)

ahydra

  • New Member
  • *
  • Posts: 19
Inconsistent behaviour with nested .inc files
« on: March 09, 2019, 02:35:10 am »
I have a project where the rough structure (for parts relevant to this topic) looks like this:

TClasses.pas includes ../common/TObjects.inc which in turn includes ../common/classes/TActor.inc

The problem is that changes to TObjects.inc are recompiled, but changes to TActor.inc are not. (I test this by making a change that definitely won't compile, e.g. property -> froperty, and it still compiles when using Shift-F9)

Also I have an issue where inactive code in IFDEFs is not rendered in the usual fainter font colour in TActor.inc. Again, this works fine in TObjects.inc.

I tried recreating the project (.lpi) file, and that fixed the second issue (highlighting), but not the first.

I also tried to reproduce this issue using a new project but everything worked as expected.

Changes to the include paths in project settings didn't make any difference, neither did adding or removing the files in project inspector.

What's going on here? How do I debug this?

Thanks,

ahydra

Blaazen

  • Hero Member
  • *****
  • Posts: 2782
  • POKE 54296,15
    • Eye-Candy Controls
Re: Inconsistent behaviour with nested .inc files
« Reply #1 on: March 09, 2019, 03:07:35 am »
Nested *.inc files works well for me now (trunk) but I had this kind of problems in past (and *.inc files even wasn't nested).

I always write a directive to *.inc file: {%MainUnit ../umain.pas}

Do you have correct paths in Project Options...> node Paths > editbox Include files  (-Fi)?

Also, what is your Lazarus/FPC version? Maybe something was fixed in meanwhile.
Lazarus 2.1.0 r59757M FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

ahydra

  • New Member
  • *
  • Posts: 19
Re: Inconsistent behaviour with nested .inc files
« Reply #2 on: March 09, 2019, 05:45:53 am »
I'm using Lazarus 2.0.0rc3 with FPC 3.0.4

The -Fi is blank, though Lazarus always seems to put $ProjOutDir in there automatically.

Thaddy

  • Hero Member
  • *****
  • Posts: 8688
Re: Inconsistent behaviour with nested .inc files
« Reply #3 on: March 09, 2019, 09:54:10 am »
The inc file problem goes away with -B
Most people that want to use threading should learn to patch their jeans first: use a needle.