运行结果及报错内容,如何解决?

是这样的,作者创建了一个C的项目,想在test.c中调用game.c的函数,却显示未定义,而在之前建的项目中却不会报错,这是为什么? 

test.c
#include

int main()
{
choose();
return 0;
}

game.h
#include
#include
#include
#include

void choose();

game.c
#include"game.h"

void choose() {
int a;
scanf("%d",&a);
switch(a) {
case 1:
game();
break;
case 2:
break;
default:
printf("选择无效!请重新选择!\n");
choose();
}
}
以上三个单元均在同一项目中,省略了大部分代码

img

img

编译时

img


之前也新建过几个项目,都是用的test.c ,game.h和game.c三个单元的形式,在test.c里调用函数,能够正常运行
不知道为什么这次失败了

test.c里面包含了game.h吗 就是说有没有#include "game.h"

你有添加声明嘛
https://blog.csdn.net/deng19936/article/details/101967928

test里面是不是导个头文件

加上#include <game.h>

我其他项目里test.c也没有#include<game.h>,但是能够正常运行,就这个不行,不清楚为什么

img