Recent

Author Topic: TAChart error compiling old project  (Read 2499 times)

bonmario

  • Sr. Member
  • ****
  • Posts: 332
TAChart error compiling old project
« on: October 17, 2021, 11:31:56 am »
Hello to all,
today I updated the sources from Gitlab, I recompiled Lazarus without errors.

I then recompiled a project that I had last compiled in June, without errors, but this time it reports these errors which I do not understand.

I am also attaching an image where you can see where the error is reported.

Quote
Messaggi, avvertimenti: 23
Warning: other unit files search path (aka unit path) of "Covid19" contains "/usr/share/lazarus/2.0.12/components/datetimectrls", which belongs to package "DateTimeCtrls"
Warning: Duplicate file "changeparentdlg.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/changeparentdlg.lfm"
Warning: Duplicate file "changeparentdlg.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/changeparentdlg.lfm"
Warning: Duplicate file "checkgroupeditordlg.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/checkgroupeditordlg.lfm"
Warning: Duplicate file "checkgroupeditordlg.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/checkgroupeditordlg.lfm"
Warning: Duplicate file "checklistboxeditordlg.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/checklistboxeditordlg.lfm"
Warning: Duplicate file "checklistboxeditordlg.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/checklistboxeditordlg.lfm"
Warning: Duplicate file "collectionpropeditform.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/collectionpropeditform.lfm"
Warning: Duplicate file "collectionpropeditform.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/collectionpropeditform.lfm"
Warning: Duplicate file "filefilterpropeditor.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/filefilterpropeditor.lfm"
Warning: Duplicate file "filefilterpropeditor.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/filefilterpropeditor.lfm"
Warning: Duplicate file "frmselectprops.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/frmselectprops.lfm"
Warning: Duplicate file "frmselectprops.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/frmselectprops.lfm"
Warning: Duplicate file "keyvalpropeditdlg.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/keyvalpropeditdlg.lfm"
Warning: Duplicate file "keyvalpropeditdlg.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/keyvalpropeditdlg.lfm"
Warning: Duplicate file "lazstringgridedit.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/lazstringgridedit.lfm"
Warning: Duplicate file "lazstringgridedit.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/lazstringgridedit.lfm"
Warning: Duplicate file "objectinspector.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/objectinspector.lfm"
Warning: Duplicate file "objectinspector.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/objectinspector.lfm"
Warning: Duplicate file "pagespropeditdlg.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/pagespropeditdlg.lfm"
Warning: Duplicate file "pagespropeditdlg.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/pagespropeditdlg.lfm"
Warning: Duplicate file "stringspropeditdlg.lfm" in "Covid19", path="/media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/stringspropeditdlg.lfm"
Warning: Duplicate file "stringspropeditdlg.lfm" in "IDEIntf 1.0", path="/usr/share/lazarus/2.0.12/components/ideintf/units/x86_64-linux/gtk2/stringspropeditdlg.lfm"
Hint: (11030) Start of reading config file /etc/fpc.cfg
Hint: (11031) End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 3.2.0 [2020/07/07] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling Covid19.lpr
(10001) PPU Loading /usr/share/lazarus/2.0.12/components/tachart/lib/x86_64-linux/gtk2/tachartaxisutils.ppu
(10011) PPU Source: tachartaxisutils.pas not found
(10028) Recompiling TAChartAxisUtils, checksum changed for /media/DiscoC/Pascal/LazarusCasa/Covid19/lib/x86_64-linux/propedits.ppu {impl}
/usr/share/lazarus/2.0.12/components/tachart/lib/x86_64-linux/gtk2/tachartaxisutils.ppu:tachartaxisutils.pas(14,36) Fatal: (10022) Can't find unit TAChartAxisUtils used by TAChartAxis
Fatal: (1018) Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

Someone can help me, please

wp

  • Hero Member
  • *****
  • Posts: 9016
Re: TAChart error compiling old project
« Reply #1 on: October 17, 2021, 11:51:43 am »
today I updated the sources from Gitlab, I recompiled Lazarus without errors.
TAChartAxisUtils *IS* distributed along with the GitLab sources. Did you do a CLEAN rebuild of the IDE?

Moreover, the many "Duplicate file" warnings may indicate that you use path settings in your application which point into Lazarus units.

The IDEIntf package should not be required by your application because it depends on many parts of the IDE which are not available to your project. If you want to reuse some component editors in your application copy these sources into your project rather than adding IDEIntf to the required packages, or extending the search path by the path to components/ideintf. Then you are also free to make the required adjustments to remove IDE-dependent parts.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

bonmario

  • Sr. Member
  • ****
  • Posts: 332
Re: TAChart error compiling old project
« Reply #2 on: October 17, 2021, 12:02:43 pm »
TAChartAxisUtils *IS* distributed along with the GitLab sources. Did you do a CLEAN rebuild of the IDE?

Yes, i did it.

I can't understand the error:

Quote
/usr/share/lazarus/2.0.12/components/tachart/lib/x86_64-linux/gtk2/tachartaxisutils.ppu:tachartaxisutils.pas(14,36) Fatal: (10022) Can't find unit TAChartAxisUtils used by TAChartAxis

You can view from attached image, that when show the error, "TAChartAxisUtils" is opened in editor.

Hi, Mario

wp

  • Hero Member
  • *****
  • Posts: 9016
Re: TAChart error compiling old project
« Reply #3 on: October 17, 2021, 12:14:38 pm »
Please show the requirements of your project (the packages listed in the tree of the project inspector), and the paths that you set in the project options.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

bonmario

  • Sr. Member
  • ****
  • Posts: 332
Re: TAChart error compiling old project
« Reply #4 on: October 17, 2021, 03:14:32 pm »
I've uploaded a screenshot of both.

I've added "$(LazarusDir)/components/ideintf" this morning in project options, because of another problem.

I've tried now on Windows, but i have same problem there.

Hi, Mario

bonmario

  • Sr. Member
  • ****
  • Posts: 332
Re: TAChart error compiling old project
« Reply #5 on: October 17, 2021, 07:46:17 pm »
I just remembered, the same thing happened to me last month on my work PC, again with a project where I use TAChart.
In the end, I solved it by doing the same thing I did back then: I created a new project in which I copied both the dialog objects and the code.

Now compiling, I have no more errors.

Hi Mario

wp

  • Hero Member
  • *****
  • Posts: 9016
Re: TAChart error compiling old project
« Reply #6 on: October 17, 2021, 08:08:30 pm »
"Percorsi di ricerca" - is this "Search path"? If yes, then you are setting up your project incorrectly. Adding Lazarus units to the "search path" is the Delphi way. In Lazarus this can cause lots of trouble, like the one you are reporting.

Suppose you need the TDateTimePicker in your project. You simply drop a TDateTimePicker component on your form from the component palette. This adds DateTimeCtrls package to the "Required packages" of your project (look at it in the Project Inspector), but not to the search path. Lazarus knows from the package where all the DateTimePicker units are. If you'd have them in the search path your project would recompile the DateTimePicker units which makes other compiled units no longer valid, and the IDE would attempt to recompile these units as well which might fail because your project does not know where all these Lazarus units are.

If you want to create the DateTimePicker at runtime, do the same: Add its package, DateTimeCtrls, to the "Required packages" of the project: Open the Project Inspector, click "Add" > "Required Packages" > Select "DateTimeCtlrs" from the package list > "OK". DO NOT ADD ANYTHING TO THE SEARCH PATH (sorry for shouting, but this is important).

Remove DateTimeCtrls, SynEdit, LazControls, and IdeIntf from the search path, and add them to the "required packages", except for the last one. Because it is another issue that use IdeIntf. This makes things even worse because now lots of code internally used by the IDE is compiled into the project.

So, two elemental rules with Lazarus projects:
1. Do not add Lazarus units to the search path, use packages instead
2. Do not use IDEIntf in your project.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

bonmario

  • Sr. Member
  • ****
  • Posts: 332
Re: TAChart error compiling old project
« Reply #7 on: October 17, 2021, 08:18:56 pm »
Ok, thanks for all !

Hi, Mario

 

TinyPortal © 2005-2018