【keil 5报错】51单片机在编写c语言时报错warning C318: can‘t open file ‘xxxx.x‘,‘xxxx‘: missing function-protot

报错内容:

Build target 'Target 1'
compiling user.c...
User\user.c(2): warning C318: can't open file 'timer.h'
User\user.c(3): warning C318: can't open file 'display.h'
User\user.c(4): warning C318: can't open file 'time_deal.h'
User\user.c(5): warning C318: can't open file 'Key.h'
User\user.c(6): warning C318: can't open file 'daley.h'
User\user.c(29): warning C206: 'Time0_Init': missing function-prototype
User\user.c(30): warning C206: 'Display_Init': missing function-prototype
User\user.c(31): warning C206: 'Time_Init': missing function-prototype
User\user.c(34): warning C206: 'Display_Process': missing function-prototype
User\user.c(35): warning C206: 'Time_Process': missing function-prototype
User\user.c(52): warning C206: 'Time_Update': missing function-prototype
User\user.c(56): warning C206: 'check': missing function-prototype
User\user.c(70): warning C206: 'Display_Scan': missing function-prototype
User\user.c(90): warning C206: 'Key_Read': missing function-prototype
User\user.c(104): warning C206: 'Key_k1': missing function-prototype
User\user.c(105): warning C206: 'Key_k2': missing function-prototype
User\user.c(105): error C267: 'Key_k2': requires ANSI-style prototype
compiling timer.c...
System\timer.c(3): warning C314: bad #directive syntax
compiling time_deal.c...
compiling daley.c...
compiling display.c...
System\display.c(50): warning C280: 'ms10': unreferenced local variable
compiling Key.c...
Hardware\Key.c(2): warning C318: can't open file 'time_deal.h'
Target not created.
Build Time Elapsed:  00:00:02

报错原因:

因为在模块化编程中,一定会互相引入模块,但是系统内部它找不到你引入模块的地址是什么,所以我们需要把会用到的模块的文件号包含进来

报错解决(图文): 

1,点击打开 options for target

2,选择c51选项卡,并在include paths中选择路径 

3,在这里将你创建的模块文件夹选中,如果多个模块就选中多个

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小辉懂编程

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值