简体   繁体   English

dcc32错误x.pas(648):E2003未声明的标识符:'x'

[英]dcc32 Error x.pas(648): E2003 Undeclared identifier: 'x'

So I've tried to add two properties to unit IdMessage.pass. 因此,我尝试将两个属性添加到单元IdMessage.pass。 So i've added 所以我加了

  TIdMessage = class(TIdBaseComponent)
  private
    FTaskID: Integer;
    FNotificationID: Integer;
  protected
   ... all protected properties and procedures


  public

   ... all protected procedures and functions

    property TaskID : Integer read FTaskID write FTaskID;
    property NotificationID : Integer read FNotificationID write FNotificationID;

  published

    ...published properties
  End;

The unit looks Ok, but when I try to compile a project that uses these two properties I get the Undeclared identifier error. 该单元看起来不错,但是当我尝试编译使用这两个属性的项目时,出现未声明的标识符错误。 I have no idea why. 我不知道为什么。 If I CTRL+CLICK the property at design time, it takes me to the property in the unit, but when I try to build or compile it runs into this error. 如果在设计时按CTRL + CLICK该属性,它将带我到单元中的属性,但是当我尝试构建或编译时,它将遇到此错误。 Any suggestions? 有什么建议么?

Despite what you say in the comments, you are modifying third party code. 尽管您在评论中说了什么,但是您正在修改第三方代码。 In effect you are making a fork. 实际上,您正在制作叉子。 The compiler error is just the first symptom of the trouble that lies ahead. 编译器错误只是即将出现的问题的第一个症状。 The compiler is not using the code that you have written. 编译器未使用您编写的代码。 The compiler is using a different version. 编译器正在使用其他版本。

For sure you can make the fork work by ensuring that the compiler uses your fork rather than the original code. 当然,可以通过确保编译器使用您的派生而不是原始代码来使派生工作。 However, you are setting yourself up for a fall. 但是,您正准备跌倒。 Next time you upgrade Indy, what will happen? 下次升级Indy时,会发生什么? Will you be able to merge your fork into the new Indy? 您将能够将叉子合并到新的Indy中吗?

If forking is the best solution, so be it. 如果分叉是最好的解决方案,那就去吧。 But it almost certainly is not. 但这几乎不是。 We don't know what your actual problem is but forking seems unlikely to be the best way forward. 我们不知道您的实际问题是什么,但是分叉​​似乎不太可能是最好的方法。 Try to find a design that allows you not to modify the Indy code. 尝试找到一个允许您不修改Indy代码的设计。

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

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