Forum > Editor

Incomplete "compilations ..."

<< < (2/2)

graemejc:

--- Quote from: Martin_fr on December 13, 2021, 01:59:06 pm ---If you share a unit between projects => put it in a package. (and remove all ppu for it, across all projects that have access).

If you add custom paths to your project settings, it gets complicated.

--- End quote ---

Packages? Fair dinkum, my computer science knowledge is desperately out of date (obviously) having last programmed regularly in the late 80s/early 90s. I'll have to research what you mean by "packages." Just bamboozled that Lazarus does not simply recognise all files and hence units that have been updated and automatically recompile them. I'm spending more time fighting with Lazarus than I am with FPC.

Nevertheless, appreciate your advice.

Thanks

Martin_fr:
Ok, more details.
Packages. There is a menu entry and it has "create new package".  The package window, then offers "add" (or "use"?) > "to project"


As Bart indicated,  it is possible to use custom paths, and have it all working. But IMHO (and that really is just an opinion) for most people it is better to create a package.

If your use path, here are a few things.
- check, if you have a ppu for the "failing" unit, in two or more locations => if so, something went wrong.
- compile with -va  and the compiler will tell you about every file/unit. When it tries to load it, where it looks for it, if it found the ppu, pas or both....
If it only sees the ppu, then it can't recompile it. Yet, yes, if correctly set up, it should of course see the pas file too.

If you just compile, the IDE leaves it to fpc to decide what needs to be recompiled (at least I am pretty sure that is the way).
If you "build clean" the IDE removes all ppu, thus forcing fpc to compile everything.

Martin_fr:

--- Quote from: graemejc on December 13, 2021, 01:41:16 pm ---or even included files have been changed and automatically compile file that depend on the altered file.     

--- End quote ---

I don't think the normal compile detects include files "{$I foo.inc}".

Not, tested, but if at all => make sure the inc file is listed in the Project Inspector as part of the project.
Files that are not in the project inspector, are not checked by the IDE.
And afaik (again not sure) fpc only checks the date of the pas/pp file for the unit.

graemejc:

--- Quote from: Martin_fr on December 14, 2021, 01:54:22 am ---- check, if you have a ppu for the "failing" unit, in two or more locations => if so, something went wrong.

--- End quote ---

Duh!. Yes, I do have a ppu (or *.pas) for the "failing" unit, in two or more locations. I think that an unchanged version was being looked at by Lazarus/FPC. I'll try that.

Thanks.

Martin_fr:
Just to clarify, I meant:
More that one ppu for the pas, within the folders seen by fpc when compiling the project.

Otherwise, you would obviously have one ppu, within the each of the projects lib folders. But since project A does not see the lib folder of project B => that is no issue.

Navigation

[0] Message Index

[*] Previous page

Go to full version