title: What is the difference between building C++ Builder project from IDE and command line?
body: <p>I have different behaviour of compiler, when building project from IDE and from command-line, which I can not explain. </p>
  
  <p>The detailed issue's description is rather big, but it's really simple.</p>
  
  <p>I have a C++ Builder project, which has a PAS-file included (IncludeUnits.pas). This pas-file has several units and inc-files listed. These files are located in separate folders and these folders are listed in library&amp;include paths in project's options.</p>
  
  <p>Folders layout:</p>
  
  <blockquote>
    <p>C:\Demo\Bin<br>
    C:\Demo\Project<br>
    C:\Demo\Project\CBuilder5<br>
    C:\Demo\Project\Common<br>
    C:\Demo\Source<br>
    C:\Demo\Source\Common</p>
  </blockquote>
  
  <p>Bin is output folder, Project/CBuilder5 holds project (bpr-file), Project/Common holds included pas-file (IncludeUnits.pas), Source and Source/Common hold other files (pas&amp;inc). I think that it's pretty usual layout.</p>
  
  <p>C:\Demo\Project\Common\ <strong>IncludeUnits.pas</strong> :</p>
  
  <pre><code>unit IncludeUnits;
  
  interface
  
  uses
    Test;
  
  implementation
  
  end.
  </code></pre>
  
  <p>C:\Demo\Source\ <strong>Test.pas</strong> :</p>
  
  <pre><code>unit Test;
  
  interface
  
  {$I Test.inc}
  
  implementation
  
  end.
  </code></pre>
  
  <p>C:\Demo\Source\Common\ <strong>Test.inc</strong> :</p>
  
  <pre><code>// this file is empty
  </code></pre>
  
  <p>If I compile this project from C++ Builder IDE - it will compile fine. C++ Builder IDE doesn't have any additional paths in IDE settings set.</p>
  
  <p>Now, I want to compile it from command-line. First, I issue</p>
  
  <blockquote>
    <p>bpr2mak.exe MyProject.bpr</p>
  </blockquote>
  
  <p>command.</p>
  
  <p>This command creates MyProject.mak file, where I can see all paths ("....\Source" and "....\Source\Common" are the paths in question):</p>
  
  <blockquote>
    <p>...<br>
    INCLUDEPATH = $(BCB)\include;$(BCB)\include\vcl;..\Common;..\..\Source;..\..\Source\Common<br>
    LIBPATH = $(BCB)\lib\obj;$(BCB)\lib;..\Common;..\..\Source;..\..\Source\Common<br>
    ...</p>
  </blockquote>
  
  <p>Now, I run make command:</p>
  
  <blockquote>
    <p>make.exe -B -f"MyProject.mak"</p>
  </blockquote>
  
  <p>It gives me the following output:</p>
  
  <blockquote>
    <p>C:\PROGRA~1\Borland\CBUILD~2\BIN\dcc32 -N2....\Bin -N0....\Bin -$Y+ -$W -$R -v -JPHNE -M -UC:\PROGRA~1\Borland\CBUILD~2\bin..\include;C:\PROGRA~1\Borland\CBUILD~2\bin..\include\vcl;..\Common;..\..\Source;..\..\Source\Common -D_DEBUG;_RTLDLL;NO_STRICT -OC:\PROGRA~1\Borland\CBUILD~2\bin..\include;C:\PROGRA~1\Borland\CBUILD~2\bin..\include\vcl;..\Common;..\..\Source;..\..\Source\Common --BCB ..\Common\IncludeUnits.PAS<br>
    Borland Delphi  Version 13.0  Copyright (c) 1983,99 Inprise Corporation<br>
    C:\Demo\Project\Common\IncludeUnits.pas(1) C:\Demo\Project\Common\IncludeUnits.pas(1) C:\Demo\Project\Common\IncludeUnits.pas(1) C:\Demo\Project\Common\IncludeUnits.pas(6) C:\Demo\Source\Test.pas(1)                 C:\Demo\Source\Test.pas(5) Fatal: File not found: 'Test.inc'</p>
  </blockquote>
  
  <p>As you can see - all search path is passed to compiler and the file (Test.inc) is all here - in that Source\Common folder. But still compiler can't find it?</p>
  
  <p>Of course, I run both commands from folder with bpr-file. And changing paths to absolute doesn't help. </p>
  
  <p>Copying Test.inc from Source\Common to Source <strong>will</strong> help. Changing {$I Test.inc} to {$I Common\Test.inc} <strong>will</strong> also help.</p>
  
  <p>Why? It seems that I'm missing something. Remember: project have no problems with compiling from IDE, Test.inc is found without copying or changing declaration. Did I miss some switch to make or dcc32?</p>