
delphi 7中, 引用其他单元中定义的类
程序有Unit1,Unit2,我在Unit2定义了一个类.在Unit1中使用了usesUnit2,但在定义类的时候:[Error]Unit1.pas(32):Declar...
程序有Unit1,Unit2,我在Unit2定义了一个类.在Unit1中使用了uses Unit2,但在定义类的时候:
[Error] Unit1.pas(32): Declaration expected but identifier 'Student1' found
[Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit1.pas' 展开
[Error] Unit1.pas(32): Declaration expected but identifier 'Student1' found
[Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit1.pas' 展开
1个回答
展开全部
写的不具体,大概说一下,
一、在Unit2中定义的类,要在implementation之前,这样引用Unit2后才能使用这个类定义。
二、delphi单元文件有,有两个地方可以使用uses引用,关键是你在unit1中关于Unit2中类的定义,必须在引用unit2之后,就好像先有引用,才能使用一样。
一、在Unit2中定义的类,要在implementation之前,这样引用Unit2后才能使用这个类定义。
二、delphi单元文件有,有两个地方可以使用uses引用,关键是你在unit1中关于Unit2中类的定义,必须在引用unit2之后,就好像先有引用,才能使用一样。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |