如何解决IAR编译错误,Error[Li005]: no definition for
Error[Li005]:nodefinitionfor"__iar_system_Mtxlock"[referencedfromxsyslock_mtx.o(dl7M_...
Error[Li005]: no definition for "__iar_system_Mtxlock" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_file_Mtxinit" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_system_Mtxinit" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_file_Mtxdst" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_system_Mtxdst" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_system_Mtxunlock" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
有谁碰到过这个情况, 展开
Error[Li005]: no definition for "__iar_file_Mtxinit" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_system_Mtxinit" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_file_Mtxdst" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_system_Mtxdst" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
Error[Li005]: no definition for "__iar_system_Mtxunlock" [referenced from xsyslock_mtx.o(dl7M_tlf.a)]
有谁碰到过这个情况, 展开
2个回答
展开全部
在uart.h中定义了一个结构体类型。
struct SERIREC{
unsigned char flag;
unsigned char Crc8_Code;
unsigned Crc16_Code;
unsigned char usedmes[7];
unsigned char i;
};extern struct SERIREC PC ; //然后再这里声明它。
在uart.c中定义PC这个结构体的实体。。
struct SERIREC PC ; // 不定义这个,就会报 no definition
编译链接错误(语法错误):编译链接错误又分成编译错和链接错。
编译错就是普通意义上的语法错,编译器进行语法检查不通过,也就是程序违背了计算机语言的语法,例如:括号不匹配、变量名拼写错误、用保留字定义变量名等;
链接错是指程序通过了语法检查,但是无法生成可执行文件,最常见的是链接找不到lib库。初学者有时写了函数的声明,但是缺少函数的定义,此时就会出现链接错。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询