用途:在linux机器上,编译C程序
安装:
以 root 用户登陆
rpm -ivh mgcc-0.7-1.i386.rpm
删除:
以 root 用户登陆
rpm -ev mgcc-0.7
使用说明:
Usage: mgcc srcfile [-c] [-o file] [-I path] [-l lib] [-L path]
-c: create object file
-o: output file
-I: include file search path
-l: library file
-L: library search path
-h: display help
例子:
1. 写一个C程序 test.c
#include<stdio.h>
int main()
{
printf("Hello World\n");
return(0);
}
2. 编译成执行文件
mgcc test.c -o test
3. 执行
./test
4. 如果想编译成.o文件
mgcc test.c -c
祝使用愉快,
如果有问题,把问题文件发给我,471711831@qq.com
也很高兴和我交流