微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

E2134 使用运行时类型信息构建时 Turbopower LockBox 代码出错

如何解决E2134 使用运行时类型信息构建时 Turbopower LockBox 代码出错

我必须使用运行时类型信息构建我的程序,因此编译器选项发出运行时类型信息被选中。
但是有了这个设置,LockBox3 单元 uTPLb_codecIntf.pas 在包含 Implementation 的行上给出错误 E2134 Type has no type info(参见源代码底部)。

LockBox3\run\(源)文件夹位于我的库路径中(由安装指定)。
LockBox DCU 位于 d:\LockBox3\packages\Sydney\Delphi\Win32\Release\ 中,日期自安装之日起。

如何在 RTTI 可用的情况下摆脱错误消息?

编辑 FWIW,这些是uTPLb_codecIntf.pas内容

interface
uses SysUtils,Classes,uTPLb_StreamCipher,uTPLb_BlockCipher,uTPLb_CryptographicLibrary;

type
TCodecMode = (cmunitialized,cmIdle,cmencrypting,cmDecrypting);

TOnEncDecProgress = function ( Sender: TObject; CountBytesProcessed: int64): boolean of object;

TGenerateAsymetricKeyPairProgress = procedure (
  Sender: TObject; CountPrimalityTests: integer;
  var doAbort: boolean) of object;


ICodec = interface
  ['{48B3116A-5681-4E79-9013-8EC89BAC5B35}']
    procedure SetStreamCipher( const Value: IStreamCipher);
    procedure SetBlockCipher ( const Value: IBlockCipher);
    procedure SetChainMode   ( const Value: IBlockChainingModel);
    function  GetMode: TCodecMode;
    function  GetStreamCipher: IStreamCipher;
    function  GetBlockCipher : IBlockCipher;
    function  GetChainMode   : IBlockChainingModel;
    function  GetonProgress  : TOnEncDecProgress;
    procedure SetonProgress( Value: TOnEncDecProgress);
    function  GetAsymetricKeySizeInBits: cardinal;
    procedure SetAsymetricKeySizeInBits( value: cardinal);
    function  GetAsymGenProgressEvent: TGenerateAsymetricKeyPairProgress;
    procedure SetAsymGenProgressEvent( Value: TGenerateAsymetricKeyPairProgress);
    function  GetKey: TSymetricKey;

    function  GetCipherdisplayName( Lib: TCryptographicLibrary): string;

    procedure Init(const Key: string; AEncoding: TEncoding);
    procedure SaveKeyToStream( Store: TStream);
    procedure InitFromStream( Store: TStream);
    procedure InitFromKey( Key: TSymetricKey);   // Transfers ownership.
    procedure Reset;
    procedure Burn( doIncludeBurnKey: boolean);

    // Asymetric support
    function  isAsymetric: boolean;
    procedure InitFromGeneratedAsymetricKeyPair;

    procedure Sign(
      Document,Signature: TStream;
      ProgressSender: TObject;
      ProgressEvent: TOnEncDecProgress;
      SigningKeys_PrivatePart: TObject;  // Must be uTPLb_Asymetric.TAsymtricKeyPart
      var wasAborted: boolean);

    function VerifySignature(
      Document,Signature: TStream;
      ProgressSender: TObject;
      ProgressEvent: TOnEncDecProgress;
      SigningKeys_PublicPart: TObject; // Must be uTPLb_Asymetric.TAsymtricKeyPart
      var wasAborted: boolean): boolean;


    procedure Begin_EncryptMemory( CipherText{out}: TStream);
    procedure EncryptMemory(const Plaintext: TBytes; PlaintextLen: Integer);
    procedure End_EncryptMemory;

    procedure Begin_DecryptMemory( PlainText{out}: TStream);
    procedure DecryptMemory( const CipherText{in}; CiphertextLen: integer);
    procedure End_DecryptMemory;

    procedure EncryptStream( Plaintext,CipherText: TStream);
    procedure DecryptStream( Plaintext,CipherText: TStream);

    procedure EncryptFile( const Plaintext_FileName,CipherText_FileName: string);
    procedure DecryptFile( const Plaintext_FileName,CipherText_FileName: string);

    procedure EncryptString(const Plaintext: string; var CipherText_Base64: string; AEncoding: TEncoding);
    procedure DecryptString(var Plaintext: string; const CipherText_Base64: string; AEncoding: TEncoding);

    procedure EncryptAnsiString(const Plaintext: string; var CipherText_Base64: string);
    procedure DecryptAnsiString(var Plaintext: string; const CipherText_Base64: string);

    function  GetAborted: boolean;
    procedure SetAborted( Value: boolean);
    function  GetAdvancedOptions2 : TSymetricEncryptionoptionSet;
    procedure SetAdvancedOptions2( Value: TSymetricEncryptionoptionSet);
    function  GetonSetIV: TSetMemStreamProc;
    procedure SetonSetIV( Value: TSetMemStreamProc);

    property  Mode: TCodecMode                   read GetMode;
    property  Key: TSymetricKey                  read GetKey;
    property  StreamCipher: IStreamCipher        read GetStreamCipher write SetStreamCipher;
    property  BlockCipher : IBlockCipher         read GetBlockCipher  write SetBlockCipher;
    property  ChainMode   : IBlockChainingModel  read GetChainMode    write SetChainMode;
    property  OnProgress  : TOnEncDecProgress    read GetonProgress   write SetonProgress;
    property  AsymetricKeySizeInBits: cardinal   read GetAsymetricKeySizeInBits
                                                 write SetAsymetricKeySizeInBits;
    property  OnAsymGenProgress: TGenerateAsymetricKeyPairProgress
                                           read GetAsymGenProgressEvent write SetAsymGenProgressEvent;
    property isUserAborted: boolean              read GetAborted write SetAborted;
  end;


implementation

end.

解决方法

LockBox 作者建议将源文件夹放在您的库路径中这一事实并不意味着您必须这样做。跟踪他们的代码很方便,但不是必需的。

只需从该列表中删除它们并将 .dcu 目录 d:\LockBox3\packages\Sydney\Delphi\Win32\Release\ 添加到其中。

这会使错误消失,而且我不需要 LockBox 源中的 RTTI。

,

您需要使用运行时信息重建 dcus。执行此操作的最简单方法(也仅包含此项目中的 dcu,而非所有项目)是在您的项目中包含源文件 uTPLb_codecIntf.pas 并构建项目。根据您需要的 RTTI,您可能需要对其他源文件重复该过程。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。