View Issue Details

IDProjectCategoryView StatusLast Update
0037556fpGUIWidgetsetpublic2020-08-13 17:16
ReporterPeter Blackman Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformLinuxOSDebian 
Summary0037556: LCL won't compile with fpGUI
DescriptionTrying to build an application with lazbuild, using --ws=fpgui
lazarus 2.0.10+dfsg-2
fpc 3.2.0+dfsg-5

I have applied the patch set from here (excluding 0005)
https://bugs.freepascal.org/view.php?id=35478

but there is an extra problem
/usr/lib/lazarus/2.0.10/lcl/interfaces/./fpgui/fpguiwsprivate.pp(166,28) Error: (5042) No matching implementation for interface method "_AddRef:LongInt; CDecl;" found
/usr/lib/lazarus/2.0.10/lcl/interfaces/./fpgui/fpguiwsprivate.pp(166,28) Error: (5042) No matching implementation for interface method "_Release:LongInt; CDecl;" found
Steps To ReproduceBuild a lazarus app with lazbuild --ws=fpgui -Br foo.lpi
Additional InformationApp works well with gtk2. Also it compiles with qt5 & gtk3.
TagsNo tags attached.
Attached Files

Activities

Peter Blackman

2020-08-12 18:56

reporter   ~0124804

I'm using the "maint" branch of fpGUI

Peter Blackman

2020-08-13 13:35

reporter   ~0124838

Here is a trivial example that reproduces the compiler error.
project1.lpi (1,948 bytes)   
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
  <ProjectOptions>
    <Version Value="11"/>
    <General>
      <SessionStorage Value="InProjectDir"/>
      <MainUnit Value="0"/>
      <Title Value="project1"/>
      <Scaled Value="True"/>
      <ResourceType Value="res"/>
      <UseXPManifest Value="True"/>
      <XPManifest>
        <DpiAware Value="True"/>
      </XPManifest>
      <Icon Value="0"/>
    </General>
    <BuildModes Count="1">
      <Item1 Name="Default" Default="True"/>
    </BuildModes>
    <PublishOptions>
      <Version Value="2"/>
      <UseFileFilters Value="True"/>
    </PublishOptions>
    <RunParams>
      <FormatVersion Value="2"/>
      <Modes Count="0"/>
    </RunParams>
    <RequiredPackages Count="1">
      <Item1>
        <PackageName Value="LCL"/>
      </Item1>
    </RequiredPackages>
    <Units Count="2">
      <Unit0>
        <Filename Value="project1.lpr"/>
        <IsPartOfProject Value="True"/>
      </Unit0>
      <Unit1>
        <Filename Value="unit1.pas"/>
        <IsPartOfProject Value="True"/>
        <ComponentName Value="Form1"/>
        <HasResources Value="True"/>
        <ResourceBaseClass Value="Form"/>
        <UnitName Value="Unit1"/>
      </Unit1>
    </Units>
  </ProjectOptions>
  <CompilerOptions>
    <Version Value="11"/>
    <Target>
      <Filename Value="project1"/>
    </Target>
    <SearchPaths>
      <IncludeFiles Value="$(ProjOutDir)"/>
      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    </SearchPaths>
    <Linking>
      <Options>
        <Win32>
          <GraphicApplication Value="True"/>
        </Win32>
      </Options>
    </Linking>
  </CompilerOptions>
  <Debugging>
    <Exceptions Count="3">
      <Item1>
        <Name Value="EAbort"/>
      </Item1>
      <Item2>
        <Name Value="ECodetoolError"/>
      </Item2>
      <Item3>
        <Name Value="EFOpenError"/>
      </Item3>
    </Exceptions>
  </Debugging>
</CONFIG>
project1.lpi (1,948 bytes)   
project1.lpr (387 bytes)   
program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, Unit1
  { you can add units after this };

{$R *.res}

begin
  RequireDerivedFormResource:=True;
  Application.Scaled:=True;
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

project1.lpr (387 bytes)   
unit1.lfm (542 bytes)   
object Form1: TForm1
  Left = 885
  Height = 373
  Top = 384
  Width = 625
  Caption = 'Form1'
  ClientHeight = 373
  ClientWidth = 625
  DesignTimePPI = 93
  LCLVersion = '2.0.10.0'
  object Button1: TButton
    Left = 32
    Height = 70
    Top = 32
    Width = 73
    Caption = 'Button1'
    OnClick = Button1Click
    ParentFont = False
    TabOrder = 0
  end
  object Image1: TImage
    Left = 280
    Height = 215
    Top = 97
    Width = 274
  end
  object OpenPictureDialog1: TOpenPictureDialog
    Left = 376
    Top = 200
  end
end
unit1.lfm (542 bytes)   
unit1.pas (571 bytes)   
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
  ExtDlgs;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Image1: TImage;
    OpenPictureDialog1: TOpenPictureDialog;
    procedure Button1Click(Sender: TObject);
  private

  public

  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  if openpicturedialog1.Execute then
     image1.Picture.LoadFromFile(openpicturedialog1.FileName);
end;

end.

unit1.pas (571 bytes)   

Peter Blackman

2020-08-13 17:16

reporter   ~0124847

Seems it a regression.
Downgrading to FPC 3.0.4 & Lazarus 2.0.8 the test app compiles.
And it also runs OK providing Application.Scaled:=False;
(Otherwise Access violation, even with an empty form!)

Issue History

Date Modified Username Field Change
2020-08-12 18:54 Peter Blackman New Issue
2020-08-12 18:56 Peter Blackman Note Added: 0124804
2020-08-13 13:35 Peter Blackman Note Added: 0124838
2020-08-13 13:35 Peter Blackman File Added: project1.lpi
2020-08-13 13:35 Peter Blackman File Added: project1.lpr
2020-08-13 13:35 Peter Blackman File Added: unit1.lfm
2020-08-13 13:35 Peter Blackman File Added: unit1.pas
2020-08-13 17:16 Peter Blackman Note Added: 0124847