【STM32】Keil5在编译过程中出现.cannot open source input file “xxx.h“: No such file or directory的问题

问题描述

main.c(10): error: #5: cannot open source input file “led.h”: No such file or directory
在这里插入图片描述

解决办法

1、点击这个图标

在这里插入图片描述

2、在C/C++选项卡下面的Include Path中添加.h文件

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
重新编译通过
在这里插入图片描述

3、检查是否包含进来,并且能不能打开

在这里插入图片描述

4、其它情况

如果已经添加.h文件路径,且确认文件路径没有问题的情况下,编译仍然报错,cannot open source input file “xxx.h”: No such file or directory的情况下,将包含头文件的上层文件夹添加到C/C++选项卡下面的Include Path中再继续尝试试试。

  • 69
    点赞
  • 100
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 15
    评论
Version: 2.15.0 (2020-09-28) Keil.STM32F4xx_DFP.2.15.0.pack Download Updated Pack to STM32Cube_FW_F4 Firmware Package version V1.25.1 using HAL Drivers V1.7.9. STM32CubeMX integration (Version 6.0.1): Added support for Timebase Source TIMx (FrameworkCubeMX_gpdsc.ftl). Removed non-existent include path. CMSIS Flash Algorithm: Corrected STM32F42xxx_43xxx_OPT Algorithm. CMSIS SVD: Updated STM32F42*.svd, STM32F43*.svd files. CMSIS-Driver: I2C: Corrected 2 byte reception in master mode. MCI: Replaced empty delay loops with _NOP(). SPI: Corrected PowerControl function (to return error if Initialize was not called, to abort active transfer if power off was requested). Updated GetDataCount function to give accurate count in DMA mode. Corrected Control function (abort in DMA mode, software controlled slave select in slave mode, TI Frame Format selection, ignore bus speed for slave mode). Corrected Uninitialize function (to power off the peripheral if it is powered). Corrected SPI3_SCK pin configuration. Corrected DMA MemDataAlignment configuration. USART: Corrected DMA MemDataAlignment configuration. USBD_HS/USBH_HS: OTG_HS ULPI clock disabled in low power if internal PHY is used to enable proper operation of OTG_HS port in FS mode during CPU sleep. CAN/EMAC/USBD/USBH: Removed macros already provided by cmsis_compiler.h. Updated Boards Examples: Migrated CubeMX projects to V6.0.1 and updated config files. Changed variant selection to "MDK-Plus" where possible. Updated all USB Host/Device examples with user templates from MDK-Middleware v7.11.1. Terminating app_main thread with osThreadExit() to avoid endless loop Updated MS Windows UBS driver files.
这个错误提示是因为在mcu6050.c文件的第12行,无法到名为".h"的源文件。根据引用\[1\]和引用\[2\]的信息,这个错误通常是由于没有正确添加头文件路径导致的。在开发单片机时,我们需要使用一些特定的头文件,如core_cmInstr.h。解决这个问题的方法是确保在工程正确添加了所需的头文件路径。根据引用\[2\]的建议,你可以检查一下是否在keil目录文件下或者安装keil的盘符下的users文件夹存在所需的头文件。另外,根据引用\[3\]的建议,还有可能是由于版本差异导致的头文件名称变化,你可以尝试更新头文件名称或者直接使用旧文件放置在工程处,并添加正确的路径。这样应该能够解决这个错误。 #### 引用[.reference_title] - *1* *2* [解决错误提示“error: #5: cannot open source input file “core_cmInstr.h“: No such file or directory...](https://blog.csdn.net/OMGMac/article/details/130477875)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [error: #5: cannot open source input fileXXX.h“: No such file or directory](https://blog.csdn.net/qq_31441951/article/details/86568812)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 15
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

废人一枚

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

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

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

打赏作者

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

抵扣说明:

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

余额充值