gcc filename1.c -o filename2.o filename1是你写的c程序文件 filename2是你想要生成的.o文件 如果你只是像下面这样写: gcc filename1.c 那么生成的时a.out文件,运行程序的时候执行 a.out文件就行了 希望以上回答能帮到你