我使用的是Delphi7,我昨天从Fulgan的页面下载了Indy (10.5462)的最新版本。
有一个批处理文件(Full_d7.bat)通常可以成功编译Indy。
现在,如果我在核心、协议和系统目录的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时,是否也需要在配置文件中定义一些内容?
发布于 2018-07-06 05:58:12
当支持没有这些类型的旧编译器时,FastMM声明了它自己的几种Delphi原生数据类型(Native(U)Int、(U)IntPtr等)的版本。
然而,它也在D2009之前的所有Delphi版本中声明了PByte,这是它不应该做的(因为PByte在RTL的System单元中可用,至少可以追溯到Delphi5)。PByte的重新声明干扰了Indy在IdGlobal单元中使用PByte -但仅在D2006之前的Delphi版本中(因为Indy在后来的Delphi版本中不直接使用FastMM )。
我已经为Indy注册了一个补丁来解决这个问题(SVN rev 5463),并在FastMM上注册了filed a bug report。
https://stackoverflow.com/questions/51169500
复制相似问题