c命令:gcc-chellohello.c扩展资料:gcc命令的基本用法gcc[options][filenames]其中,filenames为文件名;options为编译选项。
当不使用任何编译选项编译hello.c时,gcc将会自动编译产生一个a.out的可执行文件:[root@localhostc]#lshello.c[root@localhostc]#gcchello.c[root@localhostc]#lsa.outhello.c执行:[root@localhostc]#./a.outHello,World!使用-o编译选择,可以为编译后的文件指定一个名字:[root@localhostc]#lsa.outhello.c[root@localhostc]#gcchello.c-ohello[root@localhostc]#lsa.outhellohello.c执行:[root@localhostc]#./helloHello,World!注意:使用-o选项时,-o后面必须跟一个文件名,即:-ooutfile。为了便于描述后面的选项,删除hello和a.out可执行文件。