The GNU Compiler family's GCC internal password-Linux general technology-Linux programming and kernel information. The following is a detailed description. GCC User Guide
Syntax:
Gcc [option | 20021312141356.htm]...
G ++ [option | 20034712141356.htm]...
Where option is the option used for gcc (which will be detailed later ),
2001000012141356.htm is the file to be processed with gcc.
Note:
This C and C ++ compiler have integrated the related programs that generate new programs. Production
Creating a new program requires four stages: preprocessing, compilation, assembly, linking,
Both compilers can process input files in different stages. Although the original program
The extension can be used to distinguish the language used to write the original program code, but different compiler
The default handlers are different:
Gcc defaults that files that have been preprocessed (with the extension. I) are in C language, and
The link phase is processed in C connection mode.
G ++ defaults that files that have been preprocessed (with the extension. I) are in the C ++ language.
The sequential connection phase is processed in the C ++ connection mode.
The extension of the original code indicates the language used for programming and the corresponding
Management Method:
Original. c program; preprocessing, compilation, and assembly
Original. C ++ program; preprocessing, compilation, and assembly
. Cc C ++ original program; preprocessing, compilation, and assembly
. Cxx C ++ original program; preprocessing, compilation, and assembly
. M Objective-C original program; preprocessing, compilation, assembly
. I original C program that has been preprocessed; compilation and assembly
. Ii Original C ++ program that has been preprocessed; compilation and assembly
Original program of. s combination language; Assembly
Original program of. S combination language; preprocessing and compilation
. H pre-processing file (header file); (not frequently displayed in the command line)
Files with other extensions are processed by the link program, usually including:
. O Object file
. A Archive file
Unless an error occurs during the compilation process, the "Link" must be the most
Later Stage. However, you can also set the entire process from
Phase. In the connection phase, all
. O files, libraries, and other files that cannot identify attributes from the file name (including files that do not use. o
Object file with the extension and archive file with the extension.)
It is handled by the link program (the files in the command line are passed as parameters of the link Program
Link program ).
Option:
Different options must be separated. For example, the '-write' option is larger than the'-d-R' option.
Different.
Most of the '-F' and'-W' options have two forms:-fname and
-Fno-name (or-Wname and-Wno-name ). Only the non-preset ones are listed below
Format.
The following is a summary of all options. In the form. The meaning of the option will be explained in another section.
Ming.
General (rough, common) Options
-C-S-E-o file-pipe-v-x language
Program language options
-Ansi-fall-virtual-fcond-mismatch
-Fdollars-in-identifiers-fenum-int-equiv
-Fexternal-templates-fno-asm-fno-builtin
-Fno-strict-prototype-fsigned-bitfields
-Fsigned-char-fthis-is-variable
-Funsigned-bitfields-funsigned-char
-Fwritable-strings-traditional-cpp
-Trigraphs
PRAGMAS
Two '# pragma' ctictives are supported for gnu c ++,
Permit using the same header file for two purposes: as
Definition of interfaces to a given object class, and
The full definition of the contents of that object class.
# Pragma interface
(C ++ only.) Use this directive in header files
That define object classes, to save space in most
Of the object files that use those classes. Nor-
Mally, local copies of certain information (backup
Copies of inline member functions, debugging infor-
Mation, and the internal tables that implement vir-
Tual functions) must be kept in each object file
That includes des class definitions. You can use this
Pragma to avoid such duplication. When a header
File ining '# pragma interface' is supported in
A compilation, this auxiliary information will not
Be generated (unless the main input source file it-
Self uses '# pragma implementation'). Instead,
Object files will contain in references to be resolved
At link time.
# Pragma implementation
# Pragma implementation "objects. h"
(C ++ only.) Use this pragma in a main input file,
When you want full output from included header
Files to be generated (and made globally visible ).
The encoded header file, in turn, shocould use
'# Pragma interface'. Backup copies of inline mem-
Ber functions, debugging information, and the in-
Ternal tables used to implement virtual functions
Are all generated in implementation files.
If you use '# pragma implementation' with no argu-
Ment, it applies to an include file with the same
Basename as your source file; for example, in
'Allclass. CC', '# pragma implementation' by itself
Is equivalent to '# pragma implementation
"Allclass. h" '. Use the string argument if you want
A single implementation file to include code from
Multiple header files.
There is no way to split up the contents of a sin-
Gle header file into multiple implementation files.
File description
File. c C source file
File. h C header (preprocessor) file
File. I pre-processed C source file
File. C ++ source file
File. cc C ++ source file
File. cxx C ++ source file
File. m Objective-C source file
File. s assembly language file
File. o object file
A. out link edited output
TMPDIR/cc * temporary files
LIBDIR/cpp preprocessor
LIBDIR/PC3 compiler for C
LIBDIR/cc1plus compiler for C ++
LIBDIR/collect linker front end needed on some machines
LIBDIR/libgcc. a GCC subroutine library
/Lib/crt [01n]. o start-up routine
LIBDIR/ccrt0 additional start-up routine for C ++
/Lib/libc. a standard C library, see man page intro (3)
/Usr/include standard directory for # include files
LIBDIR/include standard gcc directory for # include files
LIBDIR/g ++-include additional g ++ directory for # include
LIBDIR is usually/usr/local/lib/machine/version.
TMPDIR comes from the environment variable TMPDIR (default
/Usr/tmp if available, else/tmp ).
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.