KEIL软件中出现"cannot open source input file"的问题解决方法

时间:2024-04-01 08:32:27

问题描述:因为要添加flash读写功能,因此在工程中新添加了两个文件“flash.c”和“stm32f10x_flash.h"文件,没有跟主程序放在同一个文件夹下,而是在工程目录下的hardware文件夹里面新建了一个名为“flash”的文件夹,将“flash.c”和“stm32f10x_flash.h"文件存放在“flash”文件夹下。在主函数中写了#include “stm32f10x_flash.h"语句。编译的时候出现"cannot open source input file ’stm32f10x_flash.h‘"的问题。

原因:因为是新建的文件及,没有在工程中添加“flash”的文件夹的路径。

解决方法:

1.点击下图中圈红的标志’options for target...‘

 

KEIL软件中出现"cannot open source input file"的问题解决方法

2.选择如图所示界面,点击添加文件路径。将“flash”的文件夹的路径添加到工程中。重新编译,错误解决。

KEIL软件中出现"cannot open source input file"的问题解决方法