for large C++ projects, is it better to compile all cpp files in one big call of g++ or compile them all separately and then link the result or maybe something inbetween (like compiling all files of a namespace/module/subdirectory at once).
What is the actual difference? Which method is fastest and why?
Compiling files seperately and then linking is the better practice, because it allows you to recompile only affected files in case of a modification. Hence the build time is minimized after the first build.
Actually makefiles are prepared most of the time using this approach, for the said reason.