C语言的编译过程

C语言的编译过程:

预处理、编译、汇编、链接

gcc -E hello.c -o hello.i 1、预处理

gcc -S hello.i –o hello.s 2、编译

gcc -c hello.s -o hello.o 3、汇编

gcc hello.o -o hello_elf 4、链接

 

 

 

预处理

gcc -E -I./inc test.c -o test.i

编译

gcc -S -I./inc test.c -o test.s

汇编

gcc -c test.s -o test.o

链接

gcc hello.o -o hello

posted @ 2023-02-08 23:02  菜的掉渣  阅读(17)  评论(0编辑  收藏  举报