We have a lot of Delphi Projects, when I build them before, I didn’t see any error. But recently I see the following error when I build one of those projects.
D:\Delphi Projects\MySetting.pas Fatal: Could not compile used unit ‘mscorlib_TLB.pas’
At first I thought some background process is using this mscorlib_TLB.pas, then I restart my computer and build it again, it still fails and gives the same error above. What is this mscorlib_TLB.pas error?
Thanks!
You have imported a COM object that is COM Callable Wrapper (CCW) around a managed (.net) object. The imported type
_TLB.pasfile will (sometimes needlessly) have a reference tomscorlib_TLBin itsusesclause.Delphi’s type-library importer is buggy, and there are syntax errors in the auto-generated TLB pas file.
Try removing references to
mscorlib_TLBin whatever unit is using it.If the unit actually depends on something in
mscorelib, then you’ll have to manually fix the syntax errors in the 400kB pas file.