[英]Delphi 2007 and Indy10 compile error in IdStackWindows
I've just updated my Indy10 installation to the latest revision (5276) and I now get an error when trying to compile a Windows application. 我刚刚将我的Indy10安装更新到最新版本(5276),现在我在尝试编译Windows应用程序时遇到错误。
IdStackWindows.pas(2364) Error: E2029 '..' expected but ';'
IdStackWindows.pas(2364)错误:E2029'..'预期,但';' found
发现
The issue seems to be the declaration of ka: tcp_keepalive
on line 2364 in TIdStackWindows.SetKeepAliveValues
. 问题似乎是
TIdStackWindows.SetKeepAliveValues
第2364行的ka: tcp_keepalive
声明。
I'm using Delphi 2007 on Windows 7 Professional x64. 我在Windows 7 Professional x64上使用Delphi 2007。
After further investigation I found that there is a new TCP_KEEPALIVE
constant being declared in IdWinsock2.pas: 经过进一步调查后,我发现在IdWinsock2.pas中声明了一个新的
TCP_KEEPALIVE
常量:
{$EXTERNALSYM TCP_KEEPALIVE}
TCP_KEEPALIVE = 3;
This conflicts with the existing tcp_keepalive
record, so that has been renamed to _tcp_keepalive
. 这与现有的
tcp_keepalive
记录冲突,因此已重命名为_tcp_keepalive
。 Updating the ka
variable declared in TIdStackWindows.SetKeepAliveValues()
to this new typename resolves the error. 将
TIdStackWindows.SetKeepAliveValues()
声明的ka
变量更新为此新类型名称可解决错误。
I then found another compile issue in IdSSLOpenSSL.pas: 然后我在IdSSLOpenSSL.pas中发现了另一个编译问题:
[DCC Error] IdSSLOpenSSL.pas(980): E2065 Unsatisfied forward or external declaration: 'IndySSL_CTX_use_certificate_chain_file'
[DCC错误] IdSSLOpenSSL.pas(980):E2065不满意的前向或外部声明:'IndySSL_CTX_use_certificate_chain_file'
This error can be resolved by adding a missing implementation of IndySSL_CTX_use_certificate_chain_file()
inside the {$ELSE}
section of an {$IFDEF STRING_IS_UNICODE}
block that starts at line 1155, and have it simply call OpenSSL's standard SSL_CTX_use_certificate_chain_file()
function. 可以通过在
{$IFDEF STRING_IS_UNICODE}
块的{$ELSE}
部分中添加缺少的IndySSL_CTX_use_certificate_chain_file()
实现来解决此错误,该部分从第1155行开始,并让它只调用OpenSSL的标准SSL_CTX_use_certificate_chain_file()
函数。
UPDATE: 更新:
All the necessary fixes (described above) are available in revision 5277 and later. 修订版5277及更高版本中提供了所有必要的修复程序(如上所述)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.