Professional Documents
Culture Documents
C source
code
C source
code Compilation Object code
2.obj
Linker
.
.
.
n.obj
For that purpose, a program is used called as the linker, which will take
the object files, and then it links them together and generates
Department of Railroad Integrated System
executable
Woosong Universityfile. 12
In the windows environment executable file has .exe extension
Linker will link the features that you have used from the C standard
library.
If your project is containing 1 file, then it will take that 1 file and then if
you have used any library functions in your program then it links them
together and produces the executables.
Once we have executable file, we can execute it in a computer.
During linking process also, the linker might find out that your program
is containing some errors and generate errors (and it can’t link the files).
We have to go back to our source code and fix the errors in the source
code.
Preform all the steps again Generate executable.
Department of Railroad Integrated System
Woosong University 13
C source
code
Compilation
Error Preprocessor
C compiler
No Error
.
.
.
Linker
Error
No Error
Compilation
Error Preprocessor
C compiler
No Error
.
.
.
Linker
Error
No Error
Not correct result
Department of Railroad Integrated System
Woosong University 16
Tool Set
All these steps to generate executable from the C program source file
comes in the bundle.
You have to install a bundle which contains all these software’s and
that bundle is called as tool set.
So once you install a tool set for the C programming language, you will
get all these software (compilation, linking etc.). (However, you will not
get text editor and you can use any text editor).
There are many tool sets available for example, GCC tool set and Turbo
C, Visual C++