delphi - Indy 10 编译失败并启用 FASTMM 编译器指令
问题描述
我正在使用 Delphi 7。我昨天从 Fulgan 的页面下载了最新版本的 Indy (10.5462)。
有一个批处理文件 (Full_d7.bat) 通常可以成功编译 Indy。
现在,如果我在 Core、Protocols 和 System 目录中的 IdCompilerDefines.inc 中定义 USE_FASTMM4,编译时会返回以下错误:
IdGlobal.pas(2229) Error: Declaration of 'GetBytes' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetCharCount' differs from declaration
in interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetChars' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetChars' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetChars' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetString' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(3500) Error: Incompatible types: 'Char' and 'Integer'
IdGlobal.pas(3502) Error: Incompatible types: 'Char' and 'Integer'
IdGlobal.pas(3527) Error: Incompatible types: 'Byte' and 'Char'
IdGlobal.pas(3592) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3594) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3617) Error: Incompatible types
IdGlobal.pas(3620) Error: Incompatible types: 'Word' and 'Char'
IdGlobal.pas(3663) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3665) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3687) Error: Incompatible types: 'Word' and 'Char'
这是 D7 版本中的错误还是我遗漏了什么?使用 FastMM 时,是否还需要在配置文件中定义一些内容?
解决方案
当支持没有这些类型可用的旧编译器时,FastMM 声明了它自己的几个 Delphi 本机数据类型(Native(U)Int
、、等)的版本。(U)IntPtr
但是,它也在D2009PByte
之前的所有 Delphi 版本中声明,它不应该这样做(因为PByte
在 RTL 的System
单元中可用,至少可以追溯到 Delphi 5)。重新声明 ofPByte
干扰了 IndyPByte
在IdGlobal
单元中的使用 - 但仅在 D2006 之前的 Delphi 版本中(因为 Indy 在以后的 Delphi 版本中不直接使用 FastMM)。
我已经为 Indy 签入了一个补丁来解决这个问题(SVN rev 5463),并向FastMM提交了一个错误报告。
推荐阅读
- python - Numpy 选择默认条件返回错误值
- javascript - 如何使用fs编写导入导出语句
- typescript - Zod - 为对象中的组合数组设置长度限制
- java - 如果 2+ 个前端执行相同的请求,我怎样才能使后端只允许第一个请求而忽略其余请求?
- typescript - 泛型扩展需要泛型的类型,类型推断不起作用
- r - min(which()) 在条件下没有检索到正确的数字
- javascript - Discord.js 需要帮助 TypeError: Cannot read property 'send' of undefined
- javascript - 如何在 Jquery 中添加 Javascript 等元素 - 表格问题
- android - 无法在 Android 嵌入式浏览器上使用 Facebook 登录
- date - 如何将以下字符串转换为日期或时间戳?