在implementation后面的uses 添加 不要在interface 后面的 uses添加
自己写了个UNIT,在主窗体上引用了一下,可编译时就提示 circular unit reference to UNIT ,这是怎么回事?
interface 中的uses和implementation 的uses不同在于:
interface中uses的所有单元在编译该单元时必须已编译而implementation中uses的单元
没这个必要。所以你自己编写的程序中的单元引用都放在implementation中,如果你在
unit1中的interface中引用unit2,而在unit2中的interface中引用unit1,编译程序在编译
unit1时发现unit2还没有编译,就编译unit2,而unit2又引用unit1,编译程序就会报循环
引用的错误,而在implenentation中引用就没问题。
网友评论