KEILMDK V5.36 编译一个STM32F103C8T6说core_cm3.h文件找不到的解决办法
利用KEILMDK V5.36 编译一个STM32F103C8T6说core_cm3.h文件找不到。主要错误信息如下
D:/stm32studio/Armmdk/Packs/Keil/STM32F1xx_DFP/2.4.1/Device/Include\stm32f10x.h(486): error: 'core_cm3.h' file not found
1、头文件的路径没有设置正确。
点击魔术棒(options for target)-->C/C++(AC6)下的include,添加正确的头文件路径。
2、如果出现如下提示信息
Rebuild started: Project: jxproj0001
*** Using Compiler 'V6.16', folder: 'D:\stm32studio\Keil_v5\ARM\ARMCLANG\Bin'
Rebuild target 'Target 1'
Startup/core_cm3.c(445): error: non-ASM statement in naked function is not supported
uint32_t result=0;
^
Startup/core_cm3.c(442): note: attribute is here
因为KEIL MDKV5.36默认用的是 user default compiler vision v6的编译器。
点击魔术棒(options for target)-->target-->code generation下的ARM Compiler,选择
user default compiler version 5
重新编译即可。