Reading Notes 3 GCC compiler steps

Source: Internet
Author: User
Reading Note 3 GCC compiler work steps-general Linux technology-Linux programming and kernel information, the following is a detailed description. After compiling the source code of the program, we use the GCC compiler to compile the written source code, although we only see a command, for example, we compile the Hello. c. When compiling with the GCC compiler, you only need one command: gcc-Wall Hello. c-o hello
However, in fact, it goes through four steps:
Step 1: pre-process the program with the source code suffixed with. I.
Its command is: cpp> *. I (the source code of C language after preprocessing is suffixed with. I, and the source code of C ++ is suffixed with. ii after preprocessing)
Step 2: Change the source code to the assembler program.
Command: gcc-S hello. I
Step 3: Compile the assembler code program into the target file, whose suffix is. o.
Command: as hello. s-o hello. o
Step 4: Compile the hello. o program into an executable program.
Command: gcc hello. o-o hello

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.