L6218E: Undefined Symbol"/>
ARMCLANG: L6218E: Undefined Symbol
这个报错一般常见于在keil中开启了microlib的情况,参考资料来自ARM官网的说明 :
文中描述的解决解决方法有三个思路:
- 不用 microlib。但是重定向的 printf 就需要自己写更多代码才能实现了。
- 不需要使用 assert() 函数,在编译选项中增加 “NDEBUG” 的定义。
- 重写 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
发布评论