To understandProgramFirst, you must understand what is the compiler. We use C language programs. Computers can only recognize machine languages (binary commands) and computers cannot understand them. Therefore
Converts a C language to a machine language. The compiler is used to implement this function. The compiler willSource codeFiles are mapped to binary commands that can be recognized by computers according to certain rules.
Source files, target files, and executable files
Source File: Save the source fileCodeFile (*. C, *. cpp)
Target file: the compiler generates the target code based on the machine language instructions created in the source file. The disk file containing the target code is the target file.
It is generally a (*. OBJ) file and a (*. O) file in Linux.
The target file generated after the source code is compiled cannot be directly executed. Generally, all programs we write reference the basic library functions. Therefore, we need to replace the library functions with the defined target code before running the program. This process is called a link. It is to combine the source code's target file with the target file of the library function to generate the final executable file. The link is completed by the linker.