makefile中小C程序
1楼
代码:
//first.c
#include<stdio.h>
#include"second.c"
int main(){
printf("Fighting") ;
printWords() ;
}
//second.c
#include<stdio.h>
void printWords(){
printf("The second file") ;
}
//Makefile文件
first:first.o second.o
gcc first.o second.o -o first
first.o:first.c
gcc -c first.c -o first.o
second.o:second.c
gcc -c second.c -o second.o
编译之后出错,但是将second.c中的函数和first.c中的函数调用删掉后就成功
Why??