Compilation error Delphi F2048 Bad device format

I came across an unclear error and post the solution here in the hope that this will help someone else having the same problem.

I am writing a Continuous Integration (CI) program using Delphi XE4 to ensure that the pascal source set is compiled in older versions of Delphi. This CI program launches a series of batch files, each of which launches the command line compiler of an older version of Delphi. The following error appeared in a batch file using the XE compiler:

F2048 Bad block format: 'c: \ program files (x86) \ embarcadero \ rad studio \ 11.0 \ lib \ Win32 \ release \ System.dcu' - Expected version: 22.0 ... Found version: 25.0

Please note that the expected and found versions are different (in this case, XE and XE4). Several people reported similar errors when the expected and found versions were the same - usually this is a mixture between 32 and 64-bit DCUs, but this is not a problem.

This problem only occurs when the CI program is launched from the Delphi XE4 environment. If the CI program runs outside of the IDE, it works great.

+5
source share
1 answer

The XE4 IDE adds several environment variables that inherit from a debugged program (in this case, CI), which, in turn, are inherited by batch files. One of these additional environment variables confuses the XE compiler when running in a batch file. The culprit is the added BDSLIB environment variable, which points to the XE4 lib directory.

The solution was to simply add

set BDSLIB =

at the beginning of each of the batch files. Once this change has been made, the CI program runs successfully both inside and outside the IDE.

+10
source

Source: https://habr.com/ru/post/1262247/


All Articles