300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > linux怎么编译c的源程序的?gcc 编译命令是什么? – 网络

linux怎么编译c的源程序的?gcc 编译命令是什么? – 网络

时间:2021-09-30 22:50:51

相关推荐

linux怎么编译c的源程序的?gcc 编译命令是什么? – 网络

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可执行文件。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。