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
重新編譯即可。