0

我已经安装了最新的 JCL 2016-10-10,我想安装最新的 JVCL,但我收到了一些错误消息。

我该如何安装它?

Windows 10 家庭版 (10.0.0)

JVCL 3.50.0.0

[生成:包]

为 D24 生成包

加载的模板.dpk

加载的模板.dproj

加载的模板.rc

[编译:包]

[编译:JvCore240.bpl]

Embarcadero Delphi for Win32 编译器版本 31.0

版权所有 (c) 1983,2016 Embarcadero Technologies, Inc.

E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(261) 错误:E2361 无法访问私有符号 TMemIniFile.FSections

E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(261) 警告:W1023 比较有符号和无符号类型 - 扩大了两个操作数

E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(261) 错误:预期 E2014 语句,但找到“布尔”类型的表达式

E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(274) 错误:E2361 无法访问私有符号 TMemIniFile.FSections

JvCore.dpk(2356) 致命:F2063 无法编译使用的单元“JvAppIniStorage.pas”

4

1 回答 1

1

Delphi 10.1 Berlin 版本删除了通过类助手对私有成员的访问(请参阅如何在没有助手的情况下访问私有方法?)。当访问TMemIniFile.FSections被拒绝时,这是您可以看到的错误消息。

查看JvAppIniStorage.pas的最新代码,这是固定的:

{ Optimization of TCustomIniFile.ValueExists.
  Note that this is a dirty hack, a better way would be to rewrite TMemIniFile;
  especially expose FSections. }
{$IFDEF DELPHI2009_UP}
type
  TMemIniFileAccess = class(TCustomIniFile)
  {$IFDEF RTL310_UP} // 10.1 Berlin removed the access to private fields
    {$IFDEF RTL320_UP}
      {$MESSAGE WARN 'Check that the new RTL still has FSections as the first member of TMemIniFile'}
    {$ENDIF RTL320_UP}
  private
    FSections: TStringList;
  {$ENDIF RTL310_UP}
  end;

正如代码注释中所说,这是一个肮脏的黑客,如果FSections仍然被声明为TCustomIniFile.

在代码中:

function TMemIniFileHelper.SectionExists(const Section: string): Boolean;
begin
  {$IFDEF RTL310_UP} // 10.1 Berlin removed the access to private fields
  Result := TMemIniFileAccess(Self).FSections.IndexOf(Section) >= 0;
  {$ELSE}
  Result := Self.FSections.IndexOf(Section) >= 0;
  {$ENDIF RTL310_UP}
end;

确保您拥有最新的 jvcl 源并重新编译。请注意,该符号RTL310_UPjedi.inc中定义。

于 2016-10-11T07:56:27.357 回答