c语言多文件编译不通过
小弟的c语言很差,来这里请教高手。
问题:
在一个c语言的项目里面有多个文件,经常无法编译通过。
比如:有2个c文件(fun.c test.c),fun.c用于函数实现,test.c是测试文件。代码如下:
test.c
#include<stdio.h>
#include"fun.c"
int main()
{
prin();
return 0;
}
#include<stdio.h>
void print()
{
printf("这是调用fun.c文件的函数!");
}