سؤال

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.

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

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

If you are using an Hewlett Packard PC or Laptop, you will probably need to remove the "Platform" environment setting (in windows). The Pre-configured (factory) HP windows7 has (for reasons unknown to me) an environment variable Platform=AnyCPU. This affects Delphi XE2. I found this discussion last night, which helped me: https://forums.embarcadero.com/thread.jspa?messageID=387525&tstart=0 Without that fix, I was unable to compile ANYTHING. It would choke on VCL and FireMonkey, didn't matter if I targeted 64 or 32-bit.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top