Forum > Editor

Inconsistent behaviour with nested .inc files

(1/1)

ahydra:
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:
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.

ahydra:
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:
The inc file problem goes away with -B

Navigation

[0] Message Index

Go to full version