문제

The Free Pascal 2.6.2 compiler (using Delphi mode) complained about

program project16416258;

{$mode Delphi}

uses
  Classes;

type
  TFPCTestThread = class(TThread)
  public
    constructor Create(CreateSuspended: Boolean);
  end;

constructor TFPCTestThread.Create(CreateSuspended: Boolean);
begin
  inherited;
end;

begin
end.

with this error message:

ThroughputTestUnit.pas(82,19) Error: Wrong number of parameters
specified for call to "Create" Hint: Found declaration: constructor
TThread.Create(Boolean,const LongWord="4194304");

I fixed it using

  inherited Create (CreateSuspended);  

It seems to be caused by a change in 2.6.2, TThread has a constructor declaration with an optional second argument now:

 constructor Create(CreateSuspended: Boolean;
                    const StackSize: SizeUInt = DefaultStackSize);   
도움이 되었습니까?

해결책

inherited; calls base class constructor Create(CreateSuspended: Boolean). Since base class has no constructor which takes one boolean argument, you've got your error.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top