Introduction to the GCC compiler

Source: Internet
Author: User
Tags gdb debugger

1 The GCC compiler is a compiler on a Linux system, which is a compiler collection, in other words, it compiles C, C + +, Java, Object C, PHP, and many more languages.

2 Some common options for the GCC compiler are described below

Gcc-v can be used to view the GCC version

GCC-E file: Preprocessing only, do not compile and link

Gcc-c file: Compile only, not link (. o)

Gcc-s file: Generating assembly files (. S files)

GCC file: preprocessing, compiling, linking, generating executables

Gcc-o file: Modify the target file name

3 GCC compiling a. c file generally takes four stages

Preprocessing: Handling various instructions, #开头的指令

Compile: Check syntax errors and so on (note that the concept of compiling here is different from what we are talking about, and we usually say that the compilation includes all the actions to generate the executable file)

Compilation: High-level language conversion into assembly instructions

Link: link All machine instructions

4 GCC-E hello.c-o hello.i You can save the results of the preprocessing to a hello.i file.

5 VI in $ can go to the end of the file, and uppercase G can also achieve this effect. Ng can reach the nth row.

6 The GDB tool can be used to debug the program in GCC, see the GDB Debugger series article Chenhao.


Introduction to the GCC compiler

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.