stm32库开发之keil编译报错


今天用keil编译stm32程序的时候,遇到以下错误

1. ..\usart.c(153): error:  #268: declaration may not appear after executable statement in block;

意思是变量的声明不能出现在可执行语句的后面,调整一下语句的结构,把变量的声明放到最前面就好了



2..\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol USART_ReceiveData (referred from stm32f10x_it.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol NVIC_Init (referred from usart.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol NVIC_PriorityGroupConfig (referred from usart.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol USART_Cmd (referred from usart.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol USART_GetFlagStatus (referred from usart.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol USART_ITConfig (referred from usart.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol USART_Init (referred from usart.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol USART_SendData (referred from usart.o).
.\Obj\STM3210E-EVAL.axf: Error: L6218E: Undefined symbol asm (referred from lcd.o).
.\Obj\STM3210E-EVAL.axf: Not enough information to list image symbols.
.\Obj\STM3210E-EVAL.axf: Finished: 1 information, 0 warning and 9 error messages.
Target not created

  是没有把包含该函数的文件包含进来,将库文件加入工程后编译通过

你可能感兴趣的:(STM32)