Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2024-04

Project.pp

15 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gabriele Cappelletto

HI,
I had a package that compiled well with Lazarus 2.2.4 (I used that one). Then I switched to 3.2 and it doesn't work anymore. Exactly it stops because it cannot find the file contained in lazarus/ide/Project.pp. What package should I include? And why did it work fine in Lazarus 2.2.4 (and also 2.2.6)?

exactly the uses is this

uses
? Classi, SysUtils, Controlli , Forms, Dialogs,
? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240403/1dfb054e/attachment.htm>

Reply by email

Gabriele Cappelletto
to Gabriele Cappelletto

Il 03/04/24 15:26, Gabriele Cappelletto via lazarus ha scritto:

Show quoted text 16 lines
HI, I had a package that compiled well with Lazarus 2.2.4 (I used that one). Then I switched to 3.2 and it doesn't work anymore. Exactly it stops because it cannot find the file contained in lazarus/ide/Project.pp. What package should I include? And why did it work fine in Lazarus 2.2.4 (and also 2.2.6)? exactly the uses is this uses ? Classi, SysUtils, Controlli , Forms, Dialogs, ? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts;

uses
? Classes, SysUtils, Controls, Forms, Dialogs,
? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240403/e2b1be45/attachment.htm>

Reply by email

Mattias Gaertner
to Gabriele Cappelletto
Gabriele Cappelletto wrote 22 lines
Il 03/04/24 15:26, Gabriele Cappelletto via lazarus ha scritto: > > HI, > I had a package that compiled well with Lazarus 2.2.4 (I used that > one). Then I switched to 3.2 and it doesn't work anymore. > Exactly it stops because it cannot find the file contained in > lazarus/ide/Project.pp. What package should I include? And why did it > work fine in Lazarus 2.2.4 (and also 2.2.6)? > > exactly the uses is this > > uses > ? Classi, SysUtils, Controlli , Forms, Dialogs, > ? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; > > > uses ? Classes, SysUtils, Controls, Forms, Dialogs, ? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts;

Is this the uses section of one of your package units? Does your package trying to access the IDE unit "project" directly instead of the ProjectIntf?

Mattias

Reply by email

Gabriele Cappelletto
to Mattias Gaertner

The dipindence is Synedit, Idecondif, lazdebuggergdbmi, lcl, ideinterf

this package worked on lazarus 1.6, 1.8, 2.0, 2.2.4 and 2.2.6, then I switched to lazarus 2.3 and it doesn't work anymore. Then mvk from the forum advised me to put the dependency on ideconfig and it is no longer necessary to put the path for ModeMatrixOpts, but I can't resolve the dependency for Project (lazarus/ide/Project.pp).

It basically puts a pre-compiled project on the Lazarus ide.

Il 03/04/24 15:32, Mattias Gaertner via lazarus ha scritto:

Show quoted text 31 lines
On 03.04.24 15:28, Gabriele Cappelletto via lazarus wrote: > > Il 03/04/24 15:26, Gabriele Cappelletto via lazarus ha scritto: >> >> HI, >> I had a package that compiled well with Lazarus 2.2.4 (I used that >> one). Then I switched to 3.2 and it doesn't work anymore. >> Exactly it stops because it cannot find the file contained in >> lazarus/ide/Project.pp. What package should I include? And why did >> it work fine in Lazarus 2.2.4 (and also 2.2.6)? >> >> exactly the uses is this >> >> uses >> ? Classi, SysUtils, Controlli , Forms, Dialogs, >> ? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; >> >> >> > > uses > ?? Classes, SysUtils, Controls, Forms, Dialogs, > ?? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; Is this the uses section of one of your package units? Does your package trying to access the IDE unit "project" directly instead of the ProjectIntf? Mattias

Reply by email

Gabriele Cappelletto
to Gabriele Cappelletto
 ? TProject(AProject).UseAppBundle := False;
 ? TProject(AProject).ProjResources.XPManifest.UseManifest := False;
 ? TProject(AProject).ProjResources.ProjectIcon.SetStream(nil);

This is the code that doesn't find TProject from the project unit (located in lazarus/ide/Project.pp)

Il 03/04/24 16:24, Gabriele Cappelletto via lazarus ha scritto:

Show quoted text 43 lines
The dipindence is Synedit, Idecondif, lazdebuggergdbmi, lcl, ideinterf this package worked on lazarus 1.6, 1.8, 2.0, 2.2.4 and 2.2.6, then I switched to lazarus 2.3 and it doesn't work anymore. Then mvk from the forum advised me to put the dependency on ideconfig and it is no longer necessary to put the path for ModeMatrixOpts, but I can't resolve the dependency for Project (lazarus/ide/Project.pp). It basically puts a pre-compiled project on the Lazarus ide. Il 03/04/24 15:32, Mattias Gaertner via lazarus ha scritto: > > > On 03.04.24 15:28, Gabriele Cappelletto via lazarus wrote: >> >> Il 03/04/24 15:26, Gabriele Cappelletto via lazarus ha scritto: >>> >>> HI, >>> I had a package that compiled well with Lazarus 2.2.4 (I used that >>> one). Then I switched to 3.2 and it doesn't work anymore. >>> Exactly it stops because it cannot find the file contained in >>> lazarus/ide/Project.pp. What package should I include? And why did >>> it work fine in Lazarus 2.2.4 (and also 2.2.6)? >>> >>> exactly the uses is this >>> >>> uses >>> ? Classi, SysUtils, Controlli , Forms, Dialogs, >>> ? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; >>> >>> >>> >> >> uses >> ?? Classes, SysUtils, Controls, Forms, Dialogs, >> ?? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; > > Is this the uses section of one of your package units? > Does your package trying to access the IDE unit "project" directly > instead of the ProjectIntf? > > Mattias

Reply by email

Gabriele Cappelletto
to Mattias Gaertner: Is this the uses section of one of your package units? Does your package trying to access…

The code is this

function TExtPApplicationDescriptor.InitProject(AProject: TLazProject):
TModalResult;
 ? TProject(AProject).UseAppBundle := False;
 ? TProject(AProject).ProjResources.XPManifest.UseManifest := False;
TProject(AProject).ProjResources.ProjectIcon.SetStream(nil);
TProject(AProject).CompilerOptions.ExecuteBefore.Command :=

We need the reference to TProject, how do I remove this reference?

Il 03/04/24 15:32, Mattias Gaertner via lazarus ha scritto:

Show quoted text 31 lines
On 03.04.24 15:28, Gabriele Cappelletto via lazarus wrote: > > Il 03/04/24 15:26, Gabriele Cappelletto via lazarus ha scritto: >> >> HI, >> I had a package that compiled well with Lazarus 2.2.4 (I used that >> one). Then I switched to 3.2 and it doesn't work anymore. >> Exactly it stops because it cannot find the file contained in >> lazarus/ide/Project.pp. What package should I include? And why did >> it work fine in Lazarus 2.2.4 (and also 2.2.6)? >> >> exactly the uses is this >> >> uses >> ? Classi, SysUtils, Controlli , Forms, Dialogs, >> ? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; >> >> >> > > uses > ?? Classes, SysUtils, Controls, Forms, Dialogs, > ?? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; Is this the uses section of one of your package units? Does your package trying to access the IDE unit "project" directly instead of the ProjectIntf? Mattias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240403/41a20754/attachment.htm>

Reply by email

Gabriele Cappelletto
to Gabriele Cappelletto

Fixed thanks rvk, with dependencies? dedebugger e ideconfig

Il 03/04/24 18:49, Gabriele Cappelletto via lazarus ha scritto:

Show quoted text 47 lines
The code is this function TExtPApplicationDescriptor.InitProject(AProject: TLazProject): TModalResult; ? TProject(AProject).UseAppBundle := False; ? TProject(AProject).ProjResources.XPManifest.UseManifest := False; TProject(AProject).ProjResources.ProjectIcon.SetStream(nil); TProject(AProject).CompilerOptions.ExecuteBefore.Command := We need the reference to TProject, how do I remove this reference? Il 03/04/24 15:32, Mattias Gaertner via lazarus ha scritto: > > > On 03.04.24 15:28, Gabriele Cappelletto via lazarus wrote: >> >> Il 03/04/24 15:26, Gabriele Cappelletto via lazarus ha scritto: >>> >>> HI, >>> I had a package that compiled well with Lazarus 2.2.4 (I used that >>> one). Then I switched to 3.2 and it doesn't work anymore. >>> Exactly it stops because it cannot find the file contained in >>> lazarus/ide/Project.pp. What package should I include? And why did >>> it work fine in Lazarus 2.2.4 (and also 2.2.6)? >>> >>> exactly the uses is this >>> >>> uses >>> ? Classi, SysUtils, Controlli , Forms, Dialogs, >>> ? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; >>> >>> >>> >> >> uses >> ?? Classes, SysUtils, Controls, Forms, Dialogs, >> ?? LazIDEIntf, ProjectIntf, FormEditingIntf, Project, ModeMatrixOpts; > > Is this the uses section of one of your package units? > Does your package trying to access the IDE unit "project" directly > instead of the ProjectIntf? > > Mattias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240403/392b0400/attachment-0001.htm>

Reply by email

Martin Frb
to Gabriele Cappelletto: The code is this function TExtPApplicationDescriptor.InitProject(AProject: TLazProject):…
Gabriele Cappelletto wrote 14 lines
The code is this function TExtPApplicationDescriptor.InitProject(AProject: TLazProject): TModalResult; ? TProject(AProject).UseAppBundle := False; ? TProject(AProject).ProjResources.XPManifest.UseManifest := False; TProject(AProject).ProjResources.ProjectIcon.SetStream(nil); TProject(AProject).CompilerOptions.ExecuteBefore.Command := We need the reference to TProject, how do I remove this reference?

Mind that getting this to work is only "being lucky".

It is not meant to work.
That is the unit "project" is part of the IDE, and only meant to be used by the IDE. From a license point of few, it is GPL (not LGPL), so if your code is GPL, then you are permitted to use it, but....

The unit comes with no warranties on it's interface. It could change in any way, and such changes would not be announced. (so long as the IDE and lazbuild themself are still working).

The same is true for any file inside the ide folder. And that does include files in packages inside the ide folder.

------------------

Also further more, it may (maybe) fail even if it compiles (at least I think it may). If either your code or the IDE is build with -O4 but not the other. Then FPC may produce different memory layout for the 2 equally named classes (it's only "equally name classes", it is not "equal classes"). And in future fpc could produce differences in other situations.

You best get in a feature request, so that functionality that is required can be (considered for) included in the IdeIntf. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240403/1b0270e9/attachment.htm>

Reply by email

Gabriele Cappelletto
to Martin Frb

Thanks for replying, I also take note of what you wrote. For now it works

Il 03/04/24 19:46, Martin Frb ha scritto:

Show quoted text 41 lines
On 03/04/2024 18:49, Gabriele Cappelletto via lazarus wrote: > The code is this > > function TExtPApplicationDescriptor.InitProject(AProject: > TLazProject): TModalResult; > > ? TProject(AProject).UseAppBundle := False; > ? TProject(AProject).ProjResources.XPManifest.UseManifest := False; > TProject(AProject).ProjResources.ProjectIcon.SetStream(nil); > > TProject(AProject).CompilerOptions.ExecuteBefore.Command := > > We need the reference to TProject, how do I remove this reference? > > Mind that getting this to work is only "being lucky". It is not meant to work. That is the unit "project" is part of the IDE, and only meant to be used by the IDE. From a license point of few, it is GPL (not LGPL), so if your code is GPL, then you are permitted to use it, but.... The unit comes with no warranties on it's interface. It could change in any way, and such changes would not be announced. (so long as the IDE and lazbuild themself are still working). The same is true for any file inside the ide folder. And that does include files in packages inside the ide folder. ------------------ Also further more, it may (maybe) fail even if it compiles (at least I think it may). If either your code or the IDE is build with -O4 but not the other. Then FPC may produce different memory layout for the 2 equally named classes (it's only "equally name classes", it is not "equal classes"). And in future fpc could produce differences in other situations. You best get in a feature request, so that functionality that is required can be (considered for) included in the IdeIntf.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240409/4e65cf71/attachment.htm>

Reply by email

Gabriele Cappelletto
to Martin Frb: Mind that getting this to work is only "being lucky". It is not meant to work. That is…

If even the code was gpl then there would be no commercial product for lazarus. neither tms nor anything else.

Mine is not GPL like that of many others. At least as far as this project is concerned.

If I haven't misunderstood, don't write like this if you don't want a general escape from lazarus

Il 03/04/24 19:46, Martin Frb ha scritto:

Show quoted text 41 lines
On 03/04/2024 18:49, Gabriele Cappelletto via lazarus wrote: > The code is this > > function TExtPApplicationDescriptor.InitProject(AProject: > TLazProject): TModalResult; > > ? TProject(AProject).UseAppBundle := False; > ? TProject(AProject).ProjResources.XPManifest.UseManifest := False; > TProject(AProject).ProjResources.ProjectIcon.SetStream(nil); > > TProject(AProject).CompilerOptions.ExecuteBefore.Command := > > We need the reference to TProject, how do I remove this reference? > > Mind that getting this to work is only "being lucky". It is not meant to work. That is the unit "project" is part of the IDE, and only meant to be used by the IDE. From a license point of few, it is GPL (not LGPL), so if your code is GPL, then you are permitted to use it, but.... The unit comes with no warranties on it's interface. It could change in any way, and such changes would not be announced. (so long as the IDE and lazbuild themself are still working). The same is true for any file inside the ide folder. And that does include files in packages inside the ide folder. ------------------ Also further more, it may (maybe) fail even if it compiles (at least I think it may). If either your code or the IDE is build with -O4 but not the other. Then FPC may produce different memory layout for the 2 equally named classes (it's only "equally name classes", it is not "equal classes"). And in future fpc could produce differences in other situations. You best get in a feature request, so that functionality that is required can be (considered for) included in the IdeIntf.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240409/3c9fbbfb/attachment.htm>

Reply by email

Martin Frb
Gabriele Cappelletto wrote 9 lines
> > It is not meant to work. > That is the unit "project" is part of the IDE, and only meant to be > used by the IDE. From a license point of few, it is GPL (not LGPL), > so if your code is GPL, then you are permitted to use it, but.... > If even the code was gpl then there would be no commercial product for lazarus. neither tms nor anything else.

IdeIntf is LGPL with linking exception

IDE is GPL
and the packages in the folder ide (IdeConfig, IdeDebugger) are GPL, because they used to be part of the IDE.

Commercial packages are build against the IdeIntf.

Reply by email

Martin Frb
to Gabriele Cappelletto: ? TProject(AProject).UseAppBundle := False; ?…
Gabriele Cappelletto wrote
TProject(AProject).UseAppBundle := False;

Package BuildIntf
components\buildintf\projectintf.pas => LGPL with linking exception

TLazProject(AProject).UseAppBundle := False;
TProject(AProject).ProjResources.XPManifest.UseManifest := False;
TLazProject(AProject).UseManifest := False;
TProject(AProject).ProjResources.ProjectIcon.SetStream(nil);

This may be a problem. At least I haven't found it... You can get resources...
?? TLazProject(AProject).Resources
But the class TProjectIcon isn't available.

Maybe someone else knows.

Reply by email

Gabriele Cappelletto
to Martin Frb

Done, I'm missing this, I can't find how to do this in the handbook

BMOptions: TBuildMatrixOption;
 ? BMOptions :=
TProject(AProject).BuildModes.SharedMatrixOptions.Add(bmotIDEMacro);
 ? BMOptions.Modes := 'Default';
 ? BMOptions.MacroName := 'LCLWidgetType';
 ? BMOptions.Value := 'nogui';

?I think it needs to be transformed into

 ? CompOpts : TLazCompilerOptions;

Does anyone know how to do this or how to use projectintf?

Il 09/04/24 18:48, Martin Frb ha scritto:

Show quoted text 21 lines
On 03/04/2024 16:41, Gabriele Cappelletto via lazarus wrote: > TProject(AProject).UseAppBundle := False; Package BuildIntf components\buildintf\projectintf.pas => LGPL with linking exception TLazProject(AProject).UseAppBundle := False; > TProject(AProject).ProjResources.XPManifest.UseManifest := False; TLazProject(AProject).UseManifest := False; > TProject(AProject).ProjResources.ProjectIcon.SetStream(nil); This may be a problem. At least I haven't found it... You can get resources... ?? TLazProject(AProject).Resources But the class TProjectIcon isn't available. Maybe someone else knows.

Reply by email

Gabriele Cappelletto
to Martin Frb: Package BuildIntf components\buildintf\projectintf.pas => LGPL with linking exception…

Anyway, thank you for responding to me.

Now it is just projectintf I just miss the little problem of the previous email, but it can be done by hand as well.

Il 09/04/24 18:48, Martin Frb ha scritto:

Show quoted text 21 lines
On 03/04/2024 16:41, Gabriele Cappelletto via lazarus wrote: > TProject(AProject).UseAppBundle := False; Package BuildIntf components\buildintf\projectintf.pas => LGPL with linking exception TLazProject(AProject).UseAppBundle := False; > TProject(AProject).ProjResources.XPManifest.UseManifest := False; TLazProject(AProject).UseManifest := False; > TProject(AProject).ProjResources.ProjectIcon.SetStream(nil); This may be a problem. At least I haven't found it... You can get resources... ?? TLazProject(AProject).Resources But the class TProjectIcon isn't available. Maybe someone else knows.

Reply by email

Martin Frb
to Gabriele Cappelletto: Done, I'm missing this, I can't find how to do this in the handbook BMOptions:…
Gabriele Cappelletto wrote 17 lines
Done, I'm missing this, I can't find how to do this in the handbook BMOptions: TBuildMatrixOption; ? BMOptions := TProject(AProject).BuildModes.SharedMatrixOptions.Add(bmotIDEMacro); ? BMOptions.Modes := 'Default'; ? BMOptions.MacroName := 'LCLWidgetType'; ? BMOptions.Value := 'nogui'; ?I think it needs to be transformed into ? CompOpts : TLazCompilerOptions; Does anyone know how to do this or how to use projectintf?

Not my main area of expertise, but I did some digging and found

function TBaseCompilerOptions.GetEffectiveLCLWidgetType: string;
...
 ? Vars:=GetBuildMacroValues(Self,true);
 ? if Varsnil then
 ??? Result:=Vars.Values['LCLWidgetType'];

BuildMacros are available via

TLazProject(project).LazBuildModes.LazBuildModes[n].LazCompilerOptions.BuildMacros

I hope that works...

Reply by email