Delphi 2007 command line compiler dcc32.cfg problem

I use the command line compiler to build. One of the problems I see is that the paths mentioned here seem to be short versions of the file names, so that they don't contain spaces. I don’t know much about this, although I have been using it for some time.

I recently upgraded to d2009 and the problem started.

Is there a way to shorten the path?

I have to say that I do not want to change to use the MS Build tool at this time. I just want to create an old copy of my application and get back to another job.

Here is the path used in the dcc32.cfg file for the -I , -U , -O and -R options:

 $(BDS)\LIB;$(BDS)\Imports;$(BDS)\Lib\Indy10;C:\PROGRA~1\Borland\BDS\4.0\RAVERE~1\Lib;c:\prj\lib\lib2002;C:\DOCUME~1\ALLUSE~1\DOCUME~1\RADSTU~1\5.0\Bpl;c:\DOCUME~1\mike\MYDOCU~1\BORLAN~1\bpl;C:\Prj\Lib\LOCKBO~1\source;C:\Prj\Lib\MyComp;C:\Prj\Lib\ABBREV~1\source;C:\Prj\Lib\ZLib;C:\Prj\Lib\MinMod;C:\Prj\Lib\HELPMA~1;C:\Prj\Lib\DXGETT~1;c:\windows\system32;c:\prj\lib\xpburn;C:\Prj\Lib\WININE~1;C:\Prj\Lib\regexpr\Source;C:\Prj\Lib\VCARDR~1;C:\PROGRA~1\Raize\RC4\Lib\BDS2006;C:\Prj\Lib\jcl\lib\d10;C:\Prj\Lib\jcl\source;C:\Prj\Lib\jvcl\lib\D10;C:\Prj\Lib\jvcl\common;C:\Prj\Lib\jvcl\RESOUR~1;C:\Prj\Lib\ProE6\Delphi;C:\Prj\Lib\FastMM4;C:\Prj\Lib\OPENOF~1;C:\Prj\Lib\DEVELO~1\Library\Delphi11;C:\Prj\Lib\DEVELO~1\EX38D9~1\Sources;C:\Prj\Lib\DEVELO~1\EXBD88~1\Sources;C:\Prj\Lib\DEVELO~1\XPTHEM~1\Sources;C:\Prj\Lib\DEVELO~1\EX2EBC~1\Sources;C:\Prj\Lib\DEVELO~1\EXC5FB~1\Sources;C:\Prj\Lib\DEVELO~1\EX7C7C~1\Sources;C:\Prj\Lib\DEVELO~1\EXPRES~3\Sources;C:\Prj\Lib\DEVELO~1\EXPRES~4\Sources;C:\Prj\Lib\DEVELO~1\EXC73B~1\Sources;C:\Prj\Lib\DEVELO~1\EX7165~1\Sources;C:\Prj\Lib\DEVELO~1\EXPRES~2\Sources;C:\Prj\Lib\DEVELO~1\EXPRES~1\Sources;C:\Prj\Lib\DEVELO~1\EX749C~1\Sources;C:\Prj\Lib\DEVELO~1\EX0A1A~1\Sources;C:\Prj\Lib\Mad\madBasic\BDS4;C:\Prj\Lib\Mad\MADDIS~1\BDS4;C:\Prj\Lib\Mad\MADEXC~1\BDS4;C:\Prj\Lib\Mad\MADKER~1\BDS4;C:\Prj\Lib\Mad\MADSEC~1\BDS4;C:\Prj\Lib\Mad\madShell\BDS4;C:\Prj\Lib\Mad\madShell\DeXter;C:\Prj\Lib\Mad\madExcept\..\Plugins; 

I copied it from the IDE path, as I did on the path, and used the program to shorten the path names.

Although there are no spaces in this path, it still cannot find indy IdCoder.dcu in C:\Program Files\CodeGear\RAD Studio\5.0\lib\Indy10

According to the d2007 environment variables, $(BDS) likely to expand to c:\program files\codegear\rad studio\5.0

The IDE considers this library path to be valid.

Why is this happening? I bet this is a simple mistake that I did not think about!

Thank you for your help!

+4
source share
5 answers

You can try putting quotes around the paths, which is the standard way to handle path- / filenames with spaces in Windows, although I have never tried this in Delphi DCU.

So instead

 $(BDS)\Lib\Indy10 

to try

 "$(BDS)\Lib\Indy10" 

You can also try

 "C:\Program Files\CodeGear\RAD Studio\5.0\lib\Indy10" 

to check if the environment variable is correct.

+3
source

Although the .cfg files still work in the Delphi 2007 command-line compiler, you really should use MSBuild to compile your projects. CFG files are no longer used by the IDE. Any compiler options specified by the design time are not written to the .cfg file. Using MSBuild is no more complicated than using .cfg. And if you want, this is even more flexible since you can change the actual build processes.

msbuild YourProject.dproj

+3
source

Delphi will actually give you the command line needed on the output tab when you are compiling or compiling.

  • Create your project, usually in Delphi.
  • A tab called "Exit" will appear below. Look at the line that says “Target CoreCompile” (in D2007, it may be different in other versions). The line below this will be the command line used to create your project (this is what you want). Btw - you do not need to wait for the completion of your project, you can click Cancel before it is completed, because all you need is a DCC32 command line call. In addition, if you have done the previous compilation, you can right-click and clear the output before creating it so that you do not have a lot of “noise”.
  • Click on this line to select it, then right-click on the line and select a copy.
  • Open an empty batch file and paste it. (warning, the line may be very long)
  • Now go to the beginning of this line, and if your path to the DCC32 compiler includes a space, you will need to put quotation marks around the DCC32 call, do not put quotation marks around the parameters.
  • Insert a line above the DCC32 call and enter dos commands to install the directory in the directory where your dpr file is located, otherwise DCC32 will say that it cannot find your project. For instance.
    G: then cd \Apps\MyProject
  • Save the batch file and you are ready to go.
+2
source

Is the $ (BDS) environment variable set when compiling the program from the command line? If not, this can be a problem.

Putting quotes around paths containing spaces is likely to solve the problem with spaces. This worked for me:

-U "C: \ Library Path \ First Library; C: \ Library Path \ Second Library; C: \ Library Path \ Third Library"

+1
source

Check if the applicationname.cfg file is in the current folder. First, Dcc32 will try to read the configuration from this file. Only if the file does not exist, it will be read from dcc32.cfg.

+1
source

All Articles