解决办法: 添加头文件 #include "stm32f4xx_hal_def.h"
#include "stm32f4xx.h" #include "stm32f4xx_hal_def.h"
注意:必须先添加 #include "stm32f4xx.h " 再添加 #include "stm32f4xx_hal_def.h"
否则报同样的错误