Question

I've got a BPG file that I've modified to use as a make file for our company's automated build server. In order to get it to work I had to change

Uses                       *  Uses
  unit1 in 'unit1.pas'     *   unit1
  unit2 in 'unit2.pas'     *   unit2
   ...                     *    ...

in the DPR file to get it to work without the compiler giving me some guff about unit1.pas not found. This is annoying because I want to use a BPG file to actually see the stuff in my project and every time I add a new unit, it auto-jacks that in 'unitx.pas' into my DPR file.

I'm running make -f [then some options], the DPR's that I'm compiling are not in the same directory as the make file, but I'm not certain that this matters. Everything compiles fine as long as the in 'unit1.pas is removed.

Was it helpful?

Solution

It could come from the fact, that the search path in the IDE and the search path of the command line compiler are not the same. If you change the serach path of the command line compiler you might be able to use the exactely same source code as within the IDE.

One possibility to configure the search path for the command-line compiler is to do it in a file called dcc32.cfg. Take a look at the help, there is a short description of dcc32.cfg in the IDE-help.

OTHER TIPS

Well this work-around worked for me.

//{$define PACKAGE}
{$ifdef PACKAGE}
 uses 
  unit1 in 'unit1.pas'
  unit2 in 'unit2.pas'
   ... 
{$else}
 uses 
  unit1 
  unit2
   ...
{$endif}

The only problem is whenever you add a new unit, delphi erases your ifdef package at the top.

Every time I have to put conditionals into a project file I do this:

program a;

uses
  ACondUnits;

...


unit ACondUnits;

interface

uses
{$IFDEF UseD7MM}
  Delphi7MM;
{$ELSE}
  FastMM4;
{$ENDIF}

implementation

end.

Maybe this trick works in packages too. Never tried.

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