【问题标题】:Delphi XE 10.1 JVCL Installation FailedDelphi XE 10.1 JVCL 安装失败
【发布时间】:2016-10-10 23:20:18
【问题描述】:

我已经安装了最新的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 月份得到了修复。这是一个常见的错误。确保您知道如何使用 VCS 并获取最新版本。

标签: delphi jvcl


【解决方案1】:

Delphi 10.1 Berlin 版本删除了通过类助手对私有成员的访问(请参阅How to access private methods without helpers?)。这是当访问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;

正如代码 cmets 中所说,如果 FSections 仍被声明为 TCustomIniFile 中的第一个字段,则这是一个肮脏的 hack。

在代码中:

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 中定义。

【讨论】:

  • @DavidHeffernan,也许从 oop 的角度来看,但务实的程序员会使用任何选项。
  • 嗨,大卫,感谢您的 cmets。但我做不到。
  • 我已经通过 SourceTree 下载了最新的资源。我已经成功安装了jcl。但是 jvcl 有同样的错误信息。
  • 您确认jedi.inc 包含RTL310_UP 定义吗?
  • @OsmanTaşkıran,我很清楚你的JvAppIniStorage.pas 是更新版本,但你的jedi.inc 是错误的。如果您查看编译器错误行号(第 261 行),它们与上面SectionExists() sn-p 中的{$ELSE} 指令的路径相匹配。如果 inc 文件包含正确的定义,编译器将编译第 259 行 (Result := TMemIniFileAccess(Self).FSections.IndexOf(Section) >= 0;)。
猜你喜欢
  • 2016-04-05
  • 2023-03-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-29
相关资源
最近更新 更多