gcc 编译和链接

时间:2023-02-09 22:02:50

1、现在对两个文件生成可执行文件

//thanks.c
#include <stdio.h>
int main(void) {
printf("Hello World\n"); thanks_2();
}
//thanks_2.c
#include <stdio.h> int thanks_2(void) {
printf("Hello World2\n");
return ();
}

2、步骤

一、cd 到文件所在目录

二、gcc -c 编译

三、gcc -o 链接

四、./xx  执行

gcc 编译和链接

gcc 编译和链接

备注:相关cygwin的使用说明,http://www.cnblogs.com/mlj318/archive/2011/09/07/2182351.html