简体   繁体   English

Delphi 2007 - 将 Indy 从 10.5.1.1 更新到 10.6.2.0 时出现编译错误

[英]Delphi 2007 - Compile errors on updating Indy from 10.5.1.1 to 10.6.2.0

I recently updated the stock Indy that installs with Delphi 2007 (I think it is 10.5.1.1) with 10.6.2.0, which I downloaded from GitHub.我最近将使用 Delphi 2007(我认为是 10.5.1.1)安装的库存 Indy 更新为 10.6.2.0,这是我从 GitHub 下载的。

I'm now getting a compile error:我现在遇到编译错误:

EAttachmentFileNotFound.IfFalse (FileExists (parActualAttachmentFileID), 'File ' + parActualAttachmentFileID + ' not found.') ;    
Error: E2003 Undeclared identifier: 'IfFalse'

The fragment is from my own code but I'm pretty sure that bit came from something I found probably on S/Overflow.该片段来自我自己的代码,但我很确定那部分来自我可能在 S/Overflow 上找到的东西。

I received a couple of other errors also:我还收到了其他一些错误:

SMTPClient.AuthType           := atDefault ;    
Error: E2003 Undeclared identifier: 'atDefault' 

and

SMTPClient.OnWork             := EmailThread.EmailOnWork ;
Error: E2010 Incompatible types: 'Int64' and 'Integer'

but the first is a member that was renamed, and the second a data type that was changed.但第一个是重命名的成员,第二个是更改的数据类型。 While these were a simple enough workaround, I'm left wondering虽然这些是一个足够简单的解决方法,但我还是想知道

  • whether there was ever a "breaking changes" document generated.是否曾经生成过“重大更改”文档。
  • maybe I accidentally somehow got the wrong source set.也许我不小心弄错了源集。

EAttachmentFileNotFound is not a standard Indy exception, so it must be coming from your own code, or another 3rd party library. EAttachmentFileNotFound不是标准的 Indy 异常,因此它必须来自您自己的代码或其他第 3 方库。

Delphi 2007 was released almost 16 years ago. Delphi 2007 大约在 16 年前发布。 A lot has changed in Indy during that time.在那段时间里,Indy 发生了很多变化。 In fact, I think the changes you mention were actually made prior to, or maybe around, the release of Delphi 2007 (as they already existed in Indy's code in early 2008).事实上,我认为您提到的更改实际上是在 Delphi 2007 发布之前或前后进行的(因为它们已经存在于 2008 年初的 Indy 代码中)。

For instance:例如:

  • in EIdException , the If(True|False) methods were removed (I don't know when exactly that change happened).EIdException中,删除了If(True|False)方法(我不知道确切的更改发生时间)。 In which case, you will have to use your own if and raise expressions now, eg:在这种情况下,您现在必须使用自己的ifraise表达式,例如:

     if not FileExists(parActualAttachmentFileID) then raise EAttachmentFileNotFound.Create('File ' + parActualAttachmentFileID + ' not found.');
  • in TIdComponent , the AWorkCount/Max parameters of the OnWork... events were changed from Integer to Int64 in 2006 (see OnWork Events changed to 64 bit on Indy's blog ).TIdComponent中, OnWork...事件的AWorkCount/Max参数在 2006 年从Integer更改为Int64 (请参阅Indy 博客上的OnWork 事件更改为 64 位)。

  • in TIdSMTP , the atDefault value was renamed to satDefault (again, I don't know exactly when this change was made).TIdSMTP中, atDefault值被重命名为satDefault (同样,我不确切知道何时进行了此更改)。

So, you need to update your code accordingly.因此,您需要相应地更新代码。

I'm left wondering whether there was ever a "breaking changes" document generated.我想知道是否曾经生成过“重大更改”文档。

No such document was ever created, no.从来没有创建过这样的文件,没有。 However, changes that affect user code are typically announced on Indy's blog , under the Changelog category.但是,影响用户代码的更改通常会在Indy 的博客上的Changelog类别下公布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM