0

Could someone point out some sources where I can read about the compilation procedures for large c++ projects which are build up from multiple components.

The problem is that now, if I do some modification in one of the components, I have to build the whole project from scratch.

Is there a way that allows me to build the components in a standalone manner, and when all of them are built, "join" them together into a single binary? And if I have to do a modification in one of the components, to be able to build only that component, and link it into the binary?

Thanks for your answers.

Regards, Cristian

Cristian Balint
  • 147
  • 2
  • 15
  • What do you mean by "component"? A single source file (or the object file produced by compiling it)? A third party object library? A DLL? Or what? – Peter Mar 17 '16 at 11:29
  • A group of source files which on an abstract level are forming/acting like a component. – Cristian Balint Mar 17 '16 at 11:36
  • You need loose coupling. see http://stackoverflow.com/questions/2832017/what-is-the-difference-between-loose-coupling-and-tight-coupling-in-object-orien – vcp Mar 17 '16 at 11:41
  • OK. Google "build automation". Probably the most famous such utility available freely is named make - on unix systems, and quite a few others. You'll need to learn how to configure (e.g. create a makefile that specifies how to build in various ways). There are other comparable utilities on various operating systems or from various vendors. – Peter Mar 17 '16 at 11:48

2 Answers2

0

You can use dll/library files. You can create/test/build each component as library then refer these libraries in your project.

Gilson PJ
  • 3,443
  • 3
  • 32
  • 53
0

You need to use tools like Make or CMake (I personally recommend CMake). If configured properly, they will recompile the necessary source files only.

You might want to take a look at "Advanced C and C++ Compiling", by Milan Stevanovic. Although, it is quite expensive and you don't really need it for this particular problem.

Eliad
  • 894
  • 6
  • 20