Hi All
I have next code example
unit Unit2;
//{$mode objfpc}{$H+}
{$MODE Delphi}//{$H+}
interface
uses
Classes, SysUtils;
type
TEditButtonEh = class;
{ TEditButtonEh }
TEditButtonEh = class(TCollectionItem {$IFNDEF CIL}, IUnknown {$ENDIF})
private
protected
{ IInterface }
{$IFDEF FPC}
function QueryInterface(constref IID: TGUID; out Obj): HResult; virtual; stdcall;
{$ELSE}
function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
{$ENDIF}
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
end;
implementation
{$IFDEF FPC}
function TEditButtonEh.QueryInterface(constref IID: TGUID; out Obj): HResult;
{$ELSE}
function TEditButtonEh.QueryInterface(const IID: TGUID; out Obj): HResult;
{$ENDIF}
begin
if GetInterface(IID, Obj)
then Result := 0
else Result := E_NOINTERFACE;
end;
function TEditButtonEh._AddRef: Integer;
begin
Result := -1;
end;
function TEditButtonEh._Release: Integer;
begin
Result := -1;
end;
end.
Lazarus.Win32 1.8.4 compile this unit without error.
Lazarus.Ubuntu raise next errors
Compile Project, Target: project1: Exit code 256, Errors: 3
unit2.pas(13,19) Error: No matching implementation for interface method "QueryInterface(constref TGuid;out <Formal type>):LongInt; CDecl;" found
unit2.pas(13,19) Error: No matching implementation for interface method "_AddRef:LongInt; CDecl;" found
unit2.pas(13,19) Error: No matching implementation for interface method "_Release:LongInt; CDecl;" found
I can't understand is this a feature or bug.
I need to have a "forward class declaration" in my big real unit.