gcc 编译和链接

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

//thanks.c
#include <stdio.h>
int main(void)

{
    printf("Hello World
");

    thanks_2();
}
View Code
//thanks_2.c
#include <stdio.h>

int thanks_2(void)

{
    printf("Hello World2
");
    return (1);
}
View Code

2、步骤

一、cd 到文件所在目录

二、gcc -c 编译

三、gcc -o 链接

四、./xx  执行

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

原文地址:https://www.cnblogs.com/lwngreat/p/4268648.html