“F2063 Could not compile used unit” can also mean you have a DCU file of that unit for the wrong compiler version
Posted by jpluimers on 2021/04/14
It took me a file to figure out another cause for “F2063 Could not compile used unit“, this was for a 3rd party library that had parts of the units as source files, but other parts as DCU files.
The offending unit only had DCU files, and those were in the path.
It finally occurred to me that I had a project having a DCU for the wrong Delphi version in the path.
That version check is easy to do: the 4th byte of a unit contains the CompilerVersion value with which the DCU file was compiled, and should be used with:
The first entry is for CompilerVersion value 31 (for hexadecimal value $1F) which corresponds with Delphi 10.2 Tokyo.
The last last is for CompilerVersion value 32 (for hexadecimal value $20) which corresponds with Delphi 10.3 Rio.
All versions are in Delphi version info table: C# Builder, Delphi 8 through 10.3 Rio and Appbuilder.
Related:
- [WayBack] F2063: Could not compile used unit ‘%s’
- [WayBack] delphi – Error F2063 Could not compile used unit (of dependent package) – Stack Overflow
- [WayBack] F2063 Could not compile used unit ‘QuickPDF0724.pas” error in Delphi XE4 – Stack Overflow
On the DCU and TPU file formats:
- [WayBack] Borland Delphi (vv. 2.0-9.0), Kylix (vv. 1.0-3.0) Unit
- [WayBack] Delphi Compiled Units Parser / [WayBack] DCU32INT – Программа для разбора юнитов Delphi
- [WayBack] GitHub – rfrezino/DCU32INT: Its a version of http://hmelnov.icc.ru/DCU/index.eng.html, to support RFindUnit Project
- [WayBack] The DCU32INT utility by Alexei Hmelnov. Version 1.25.1
- [WayBack] DCU32INT FAQ.
- [WayBack] c++ – What is a Delphi DCU file? – Stack Overflow
–jeroen






Leave a comment