gcc有很多用法,那么我们用的最多的就是罪普通的将源文件编译成课执行文件,例如
在vi编辑器下编译好了helloworld.c,想要编译运行时,可这样:
#gcc helloworld.c
此时该目录下会出现一个a.out的文件,要执行它,只需:
#./a.out
如果想将可执行文件的名称与源文件一致时,可以这样:
#gcc helloworld.c -o helloworld
即可
转载于:https://blog.51cto.com/mco3018/476537
gcc有很多用法,那么我们用的最多的就是罪普通的将源文件编译成课执行文件,例如
在vi编辑器下编译好了helloworld.c,想要编译运行时,可这样:
#gcc helloworld.c
此时该目录下会出现一个a.out的文件,要执行它,只需:
#./a.out
如果想将可执行文件的名称与源文件一致时,可以这样:
#gcc helloworld.c -o helloworld
即可
转载于:https://blog.51cto.com/mco3018/476537