keil5出现‘Target not created‘

keil5出现‘Target not created‘

新建工程中写了main函数进行编译时出现错误的问题:

*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
compiling main.c...
D:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h(483): error:  #5: cannot open source input file "core_cm3.h": No such file or directory
  #include "core_cm3.h"
User\main.c: 0 warnings, 1 error
".\Objects\Project.axf" - 1 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:00

查找报错的关键提示:cannot open source input file "core_cm3.h": No such file or directory
  #include "core_cm3.h"

这是因为你装的MDK版本太新了,比如MDK5.12/5.13,它们不会从MDK安装目录去查找头文件。 所以导致这个错误。
解决方法如下:
把core_cm3.h文件复制到keil软件安装的include目录下:
D:\自己的安装目录下\ARM\PACK\Keil\STM32F1xx_DFP\2.2.0\Device\Include

添加完再次运行,就不报错了。

*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
compiling main.c...
linking...
Program Size: Code=648 RO-data=252 RW-data=0 ZI-data=1632  
".\Objects\Project.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed:  00:00:00

你可能感兴趣的:(#,嵌入式报错,单片机,stm32,嵌入式硬件)