GCC基本使用

gcc用于编译C,g++用于编译cpp

gcc [-c|-S|-E] [-std=standard]

           [-g] [-pg] [-Olevel]
           [-Wwarn...] [-Wpedantic]
           [-Idir...] [-Ldir...]
           [-Dmacro[=defn]...] [-Umacro]
           [-foption...] [-mmachine-option...]

           [-o outfile] [@file] infile...

常用参数

    -c 只编译,不链接,输出.o,通常用于编译不包含主程序的子程序文件

    -o outPutFile 输出文件名,默认值a.out

    -g 输出可调试的二进制文件

    -O/O2/O3 编译优化,提高可执行文件执行效率,但降低编译速度

    -S 输出汇编文件,默认输出文件名$name.s

猜你喜欢

转载自blog.csdn.net/qq_37968132/article/details/79685562