GCC common command description

xiaoxiao2021-03-06  121

Under UNIX develops commonly used compilation GCC, I know very little about GCC,

Generally used is gcc -o xx xx.cpp

Today, I flipped GNU GCC Manual spent some time summed up.

Share your family! Oh, I hope to help everyone.

Here you will introduce the common command options for GCC (you can refer to GNU GCC Manual).

1. The language supported by GCC.

GCC is full of GNU Compiler Collection, including some main compiler support language C, C , Objective-C, compilation of Java, Fortran, And Ada.

2.GCC Command Options

When performing GCC, it is usually four processing procedures, preprocessing, compilation, assembly and linking. You can stop to a process by adding different options.

a. Total option.

-c -s -e -o file -pipe -pass-exit-code

-x Language -V - ### --help --target-help --Version

The compiler compiles the file to pass through four phases, as mentioned above. It is done in order.

The compiler determines which phase of the input file:

File.c C files should be processed by Yu.

File.i C source files do not have to be processed.

File.II C source files do not have to work.

File.h C / C Yu compile head file.

File.cc

File.cp

File.cxx

File.cpp

File.cpp

File.c

File.c C source files should be processed by Yu.

File.hh

File.h C header files are converted to a humid header file.

File.s

AskEMBLER CODE.

File.s

Assembler Code Which Must Be Preprocessed

-x logage ========= option is to specify language telling the language of the GCC file,

Unnecessary default suffix identification.

Languge can be:

C c-header cpp-output

C C - Header C - CPP-OUTPUT

Objective-c Objective-c-header objc-cpp-output

askEMBLER Assembler-with-CPP

ADA

F77 F77-CPP-INPUT RATFOR

Java

Treelang

-x None uses suffix identification to turn off language recognition.

-c is only compiled and does not connect, and it is the target file. .c, .i, .s ==> .o

-S just compiling does not assemble, generate assembly code. .C, .i ==>. S

-E is only compiled, and does not do other processing.

-o file outputs the output file to the file.

-v Prints command line information for each process compiled inside the compiler. And the version of the compiler.

- ### 同, but do not really perform the command.

-pipe compiler compiles the information of each phase is saved to temporary files, if you don't want

With temporary files, you can use the pipeline. This command option is used. However, some systems are not supported.

Editor's Note: No pair of netizens added

There are other options such as -on (n = 1, 2, 3) -Arch = Pentium4 these for optimization

-g for debugging

There is also a PROF supported to determine the operational efficiency of the program.

转载请注明原文地址:https://www.9cbs.com/read-101312.html

New Post(0)