C/C ++ executable file generation process

Source: Internet
Author: User

For example, the C executable file is generated in four steps in the box:

1. Preprocessing: the preprocessing result is still a c file, but it is suffixed with. I. The so-called preprocessing process starts with #, for example, # include <stdio. h>, the pre-processor will read the file stdio. h Insert the file content directly in # include <stdio. h>. It will also process the # define macro.

2. CCL converts. I to an assembly language. Each assembly statement describes a machine instruction. The assembly language provides a common output language for different compilers and different advanced languages. For example, C and FORTRAN generate the same assembly language.

3. Convert to machine commands .. The o file is a binary file that uses machine instruction encoding instead of character encoding. So if you use a text editor to view the. o file, it looks messy.

4. Link stage. Our C program may use other compiled. O files. For example, if printf is used, the printf. o file must be integrated with our. o file. The connector executes this fusion and generates executable files.

 

The compilation process of C ++ is similar to that of C. It is first converted to C before other processes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.