Lazarus 4.0RC1/fpc3.3.1安装ehlib 10时出现以下出错:
EhLibReg.pas(761,27) Error: Incompatible type for arg no. 1: Got "Constant String", expected "LongInt"
原因:
lazarus 4.0rc1改变了Modified的定义
lazarus 4.0RC1之前的定义:
procedure TPropertyEditor.Modified(PropName: ShortString); begin if PropertyHook <> nil then PropertyHook.Modified(Self, PropName); end;
lazarus 4.0RC1之后改为:
procedure TPropertyEditor.Modified(Index: integer); var PropName: ShortString; begin if PropertyHook = nil then exit; with FPropList^[Index] do begin if PropInfo<>nil then PropName:=PropInfo^.Name else PropName:=''; end; PropertyHook.Modified(Self, PropName); end;
出错的处理方法:
将
if EditPropStorage(TPropStorageEh(Obj)) then Modified('StoredProps');
改为:
if (EditPropStorage(TPropStorageEh(Obj))) and (ProperyHook<>nil) then PropertyHook.Modified(Self, 'StoredProps');
重新编译就可以正常安装ehlib.