Why is it important to separate compilation and linking processes in C?

I programmed in C for a while, and I wondered why it is important to separate these processes (compilation and linking)?

Can someone please explain?

+4
source share
5 answers

This is useful for reducing recovery time. If you change only one source file - often there is no need to recompile the entire project, but only one or several files.

+5
source

. . (, extern).

, , . ( wikipedia , )

Make, , , Make, , , . . (, linux kernel).

+2

, -.

, - " " 1980- . , , , ( ) .

"object files" - .obj (DOS/Windows/VMS) .o (unix) - , (, ) (, ). (.lib, .a, .so, .dll ..) .

, make, - - C, ​​Linux.

, . , C Fortran COBOL ++ ..

, , , . ++ , .o (. ++ name mangling). Java et al "native code", DLL .

+2

. ,

gcc f1.c f2.c f3.c f4.c -o program

program .

: , .

0

, . , 2 .

0

All Articles