C/C++教程

keil WARNING L1 : UNRESOLVED EXTERNAL SYMBOL 和 WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL

本文主要是介绍keil WARNING L1 : UNRESOLVED EXTERNAL SYMBOL 和 WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

keil编译出现如下警告:

WARNING L1: UNRESOLVED EXTERNAL SYMBOL

SYMBOL:  UART0

MODULE:  .\obj\app_uart0.obj (APP_UART0)

 

WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL

SYMBOL:  UART0

MODULE:  .\obj\app_uart0.obj (APP_UART0)

ADDRESS: 31ACH

 

解决办法:L1和L2是同一问题,是Uart0在程序中使用了,但是没定义;

如下:uart.h文件中结构体

typedef struct
{
   u8 RxOk;
}USART_DEF;
extern USART_DEF Uart0;

uart.c中需要定义下USART_DEF Uart0;

这篇关于keil WARNING L1 : UNRESOLVED EXTERNAL SYMBOL 和 WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!