Gcc compiler parameters

  
 

gcc/g++ When performing compilation work, a total of 4 steps are required.

1. Preprocessing, generating .i files 2. Converting preprocessed files into assembly language and generating files. S3. There is assembly to become the target code (machine code) to generate the .o file. 4. Connect the target code, generate the executable program [parameter details]

-c Only activate preprocessing, compilation, and assembly, also That is, he only makes the program into the obj file. Example usage: gcc -c hello.c He will generate the .o obj file -S only activates preprocessing and compiling, which means compiling the file into assembly code. Example usage gcc -S hello.c He will generate the assembly code for .s, you can use the text editor to view -E only activate preprocessing, this does not generate files, you need to redirect it to an output file. : gcc -E hello.c > pianoapan.txt gcc -E hello.c

Copyright © Windows knowledge All Rights Reserved