在学习C语言跨文件调用函数时,总是报ld returned 1 exit status的错误,经查询后也无法确定原因,找不到解决办法,求解答
使用的软件是Devc++。
test.h
#ifndef LINKNODE_A
#define LINKNODE_A
#include<stdio.h>
extern int a ;
extern void fun1() ;
#endif
test.c
#include<stdio.h>
#include"test.h"
int a = 1 ;
void fun1()
{
printf("%d", a) ;
}
main.c
#include<stdio.h>
#include"test.h"
int main()
{
fun1();
return 0;
}
test.c去掉
#include"test.h"
出现这样的问题是因为数组过大,64位也无法容纳,所以我们将数组调小即可