GCC Features
The GCC (gun C Compiler) is a powerful, performance-rich multi-platform compiler that is launched by gun. The efficiency of the execution is higher than the average compiler 20%~30%.
Basic uses of GCC
gcc [options] Filenames
GCC compilation process
Hello.c-> Precompiled->hello.i-> compilation->hello.s-> compilation->hello.o-> link->hello
GCC-E hello.c-o hello.i "-e" means to perform preprocessing "-o" for output file name
Gcc-s hello.i-o Hello.s "-S" means to perform the compilation
Gcc-c hello.s-o hello.o "-C" means execution assembly
GCC hello.o-o Hello means execution link
Common file types
. c:c file
. h: Header files
. S: assembly file
. O: Target file
. C or. cc or. cxx:c++ files
. A: Library files
GCC compilation options
-o FileName: Specifies the output file name
-O: Optimizations to the compiler, such as removing variables that are not used in the program
Time/FILENAME Statistics program uptime
-o2: Optimized for compiler, more than-O
-C: Do not link, generate. o File
-G: Generate a program with debugging information, debugging with GDB requires the compiler to have this option
-I: Add non-standard header file path, GCC standard look for header file path/usr/include/
-wall: Generate all warnings
-W: Do not generate any warnings
-d (macro): definition (macro) macros, equivalent to using # define (macro) in a program
[state-Embedded notes] [012] [GCC Program compilation]