Question

IDE: Delphi 6 Professional.

We have big projects.

I cannot use Project Groups to build them all, because I got OM errors, and strange file errors when I did it.

My idea was that I will use DCC32.exe Priorly I had a fight with the command line parameters (dcc32.cfg), but it I thought I solved it...

Today I tried to compile projects with it, but at first project I got errors.

chdir c:\d\anyproject dcc32 -b any.dpr

The error reported me that it wasn't found a unit. I tried to compile in Delphi, and it was successful.

So I checked the problem. Why the previous project buildings were successful, and why this wasn't...?

Then I realized that this dpr is using references to a subdirectory, but not all files added to the project, more of them are linked by project's "search path".

But if it's true, then this meaning that DCC32 ISN'T USING THE PROJECT'S DOF/CFG FILES!

So the problem is that Delphi merges everything to provide the result. It merges the global search paths, the project's compiler directives, the searching paths, so everything, and using the project's conditional directives too.

If I understand it well, the DCC32 don't use, only the dcc32.cfg, and I must merge everything for the compilation, what is an impossible job, because I need to write a parser what is interprets the project's parameters, and merges with globals.

Or I misunderstand something, and the problem is caused by other thing what I missed?

I waiting for your suggestions!

Thanks for all idea, link, info, etc.

Was it helpful?

Solution

dcc32 options from the following places:

  1. A dcc32.cfg file. This can be either in the current directory, or the same directory as dcc32.exe.
  2. The command line.
  3. The source code.

I have order these in order of increasing precedence. So, an option specified in source code always overrides settings made a dcc32.cfg file, or on the command line.

dcc32.exe will choose whichever dcc32.cfg file it finds first. It looks in the current directory first.

What all this means is that you are responsible for getting the settings from the .dof file, and from the IDE into your command line compilation environment.

This is one of the many reasons why you should upgrade. Modern Delphi versions use msbuild for command line compilation and make it trivially easy to be sure that your command line builds are the same as IDE builds.

When you watch an msbuild in progress you will see that it results in a call to dcc32.exe with all options specified on the command line. Transforming the project settings into a call to dcc32.exe is what you are now faced with. In Delphi 6 you have to do that yourself. In modern Delphi, the tools are part of the product.

OTHER TIPS

This might help:

http://delphi.wikia.com/wiki/Compile_from_Commandline

It describes how to do commanline compiles with Delphi versions from Delphi 1 to XE3 and also links to the tool dof2cfg which you might find helpful.

IIRC the command line compiler always uses a configuration file named dcc32.cfg found either in the current folder or where dcc32.exe resides. You may try to rename or copy your .cfg file to dcc32.cfg and see if that solves your problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top