Is there any reason to prefer linker commands over include directives if you don’t plan on recompiling the included files separately?
P.S. If it matters, I’m actually concerned with C++ and g++, but I thought gcc would be more recognizable as a generic compiler.
Yes. You’ll get into serious trouble if you include implementation (
.c) files here and there. Meet the infamous “Multiple definitions of symbol _MyFunc” linker error…(By the way, it’s also considered bad style/practice, in general, only header files are meant to be included.)