views:

1026

answers:

6

Why BCB 6 always compile all files. I make come changes on one file but BCB 6 compile all files when i start app. Any idea? I use WinXP SP2.

+1  A: 

Are you source files and binary objects located on the same machine? If not sounds like you have a network time sync issue.

If they are its most likely a header file issue, either the compiler include files have a modified date some time in the future or your application is dependent on some header file that changes during compilation say from a COM import.

EDIT: Check the setting VS has a flag to always re-compile, this might be true for BCB too, if set then unset it. Another possibility is that pre-compiled headers are miss-configured to generate on every source file.

I am not familiar with BCB 6 to give a more precise answer.

titanae
A: 

Yes, all files are located on the same machine. Some files are not modified couple years, but BCB always compile it.

SelvirK
Check the setting VS has a flag to always re-compile, this might be true for BCB too, if set then unset it.Another possibility is that pre-compiled headers are miss-configured to generate on every source file.
titanae
+1  A: 

try this plugin for BCB compiler: Bcc32Pch IDE Plugin

A: 

Make sure you are using the "make" command and not the "build" command, unless it is required.

Making a project with the Borland tools has always seemed to have that issue -- that it doesn't necessarily notice which ones have changed and starts to compile everything.

Look at the Pre-Compiled Headers options, which may help speed things up.

When Borland/CodeGear, starting in C++Builder 2007, switched to the MSBuild system, the compilations have gone much faster and are more efficient.

Kris Kumler
+1  A: 

Have you made all or many of your files dependent on a particular module?

Any files that are dependent on a particular module will be rebuilt any time the module class structure (contained in the .h file) is modified. If, for example, you have a data module that is accessed by many other modules you will see a rebuild of all dependent modules each time the data module's class structure is modified.

Kluge
+1  A: 

There are an pragma in Borland, wich controls how many lines of code is recompiled.

In the past years i have managed (in some project), that only changes of my source are compiled. I don't know, if this will be worked in newer versions of borland

Borland 6 has an pragma "hdrstop". this is only active, if the project option "Pre-Compile headers" is NOT "none"

years ago I have an very slow computer an i accelerate the compilition time from hours to minutes with following trick

all cpps have become this first line

#include "all.h"
#pragma hdrstop

default was an include of "vcl.h"

"all.h" will includes all header, wich are needed in all! units. every unit will skip all sources, wich depend on header before pragma hdrstop.

Example:

Unit1.h

 #include <string>

Unit1.cpp

   #include "all.h"
   #pragma hdrstop

   #include "Unit1.h"

Unit2.h

 #include <vcl>

Unit2.cpp

   #include "all.h"
   #pragma hdrstop

   #include "Unit2.h"

all.h

   #include <string>
   #include <vcl>


Importing

  1. dont use all.h in headerfiles
  2. you can add all includes, wich are used in the project header, like ,
  3. All sources wich depend on the "pre compiled headers" will not be compiled again!
  4. generation of precompiled headers will be slow! So only add headers in all.h, which will not be changed often. Like system headers or your headers wich are already finished.
  5. compilation can be failed. sometimes the order of the includes produce an "deadlock" for the comilation. if its happen, deactivate "pre-compiled headers". Most problems will be solved, if you write your c++ like in java: every class will become his own files(cpp and h).
  6. Filename in the project option "Pre-Compiled headers" shows the basename of the real precompiled files. an unit can share an precompiled file with another unit, if it have (exact) the same inludes before "pragma hdrstop". Best performance is reached, if you have only one file with an numeric postfix. Example for more than one precompiled header:

Unit1.h

 #include <string>

Unit1.cpp

   #include "all.h"
   #pragma hdrstop

   #include "Unit1.h"

Unit2.h

 #include <vcl>

Unit2.cpp

   #include <vcl> //!!!!!!!!!!!!!!!!!!! produce a second version of an precompiled file
   #pragma hdrstop

   #include "Unit2.h"

all.h

  #include <string>
  #include <vcl>