gcc/g++命令参数(笔记)
发布时间
阅读量:
阅读量
1. gcc -E source_file.c
-E,只执行到预编译。直接输出预编译结果。
2. gcc -S source_file.c
-S,只执行到源代码到汇编代码的转换,输出汇编代码。
3. gcc -c source_file.c
-c,只执行到编译,输出目标文件。
4. gcc (-E/S/c/) source_file.c -o output_filename
-o -- specify output file name, which can be accompanied by the above three tags. The -o option can be omitted in this case. The compiler will employ the following default naming convention for output:
-E:预编译结果将被输出到标准输出端口(通常是显示器)
-S:生成名为source_file.s的汇编代码
-c选项用于创建名为source_file.o的目标文件;在无标签情况下,默认生成名为a.out的可执行文件。
-c选项用于创建命名为source_file.o的目标文件;在无标签情况下,默认生成命名为a.out的可执行文件。
5. gcc -g source_file.c
全部评论 (0)
还没有任何评论哟~
