delphidelphi-2007indy10

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.

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.

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


Solution

  • EAttachmentFileNotFound is not a standard Indy exception, so it must be coming from your own code, or another 3rd party library.

    Delphi 2007 was released almost 16 years ago. A lot has changed in Indy during that time. 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).

    For instance:

    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.