Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi XE2: Fail using dcc32.exe to compile a simple program

After install Delphi XE2, I try command line compiler dcc32.exe to compile a simple program:

program test;

uses SysUtils;

begin
end.

The command line compiler show me error:

c:> dcc32.exe test.dpr
Embarcadero Delphi for Win32 compiler version 23.0 Copyright (c) 1983,2011 Embarcadero Technologies, Inc.
test.dpr(3) Fatal: F1026 File not found: 'SysUtils.dcu'

This doesn't happen to Delphi XE.

like image 861
Chau Chee Yang Avatar asked Sep 07 '11 07:09

Chau Chee Yang


3 Answers

I know it's not the answer to your direct question (Uwe and Nat have that covered), but you would be much better off building with msbuild. That way you'll pick up all the settings in your .dproj file.

The build command should look like this:

msbuild test.dproj /t:Rebuild /p:Config=Release

If you are building this from a batch script, you'll need to make sure it can see the right msbuild. Do it like this:

call "path\to\delphi\installation\bin\rsvars.bat"
msbuild test.dproj /t:Rebuild /p:Config=Release
like image 79
David Heffernan Avatar answered Oct 12 '22 03:10

David Heffernan


If you just want to use the command line (without dcc32.cfg), the command line parameter you are looking for is -NS to specify the namespaces to search in...

So, you would have something like this:

dcc32.exe -NSsystem;vcl test.dpr

This should make the compiler look for units in the System and VCL namespaces (VCL added to show how to append more than one namespace).

This information was found on the Embarcadero Discussion Forums. I don't yet have XE2 so I couldn't test it.

like image 39
Nat Avatar answered Oct 12 '22 02:10

Nat


Due to the new namespaces in the RTL and VCL you have to specify an additional command line parameter to the compiler. Try "-NSSystem;System.Win;WinAPI;Vcl;Vcl.Imaging;Data" and add other namespaces as needed.

like image 42
Uwe Raabe Avatar answered Oct 12 '22 03:10

Uwe Raabe