ARMCLANG: L6218E: Undefined Symbol

编程入门 行业动态 更新时间:2024-10-15 08:21:27

ARMCLANG: <a href=https://www.elefans.com/category/jswz/34/1742470.html style=L6218E: Undefined Symbol"/>

ARMCLANG: L6218E: Undefined Symbol

这个报错一般常见于在keil中开启了microlib的情况,参考资料来自ARM官网的说明 :

文中描述的解决解决方法有三个思路:

  1. 不用 microlib。但是重定向的 printf 就需要自己写更多代码才能实现了。
  2. 不需要使用 assert() 函数,在编译选项中增加 “NDEBUG” 的定义。
  3. 重写 assert() 函数。在文档中也有说明,如果一定要 assert() 这个功能,那就直接复制文档中的代码吧。
__attribute__((weak,noreturn))
void __aeabi_assert (const char *expr, const char *file, int line) {char str[12], *p;fputs("*** assertion failed: ", stderr);fputs(expr, stderr);fputs(", file ", stderr);fputs(file, stderr);fputs(", line ", stderr);p = str + sizeof(str);*--p = '\0';*--p = '\n';while (line > 0) {*--p = '0' + (line % 10);line /= 10;}fputs(p, stderr);abort();
}__attribute__((weak))
void abort(void) {for (;;);
}
  • END

更多推荐

ARMCLANG: L6218E: Undefined Symbol

本文发布于:2024-02-23 10:49:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1695346.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:L6218E   ARMCLANG   Symbol   Undefined

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!