ARMCLANG: L6218E: Undefined Symbol __aeabi_assert

这个报错的出现一般常见于开启了mirlib的情况,参考资料来源 :

https://developer.arm.com/documentation/ka004216/latest

解决方案按照说明:
1.Open the Manage Run-Time Environment dialog and expand Compiler -> I/O.
2.重写函数或添加:

__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 (;;);
}

3.添加 "NDEBUG."宏
在这里插入图片描述
4.关闭mirlib
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/GongmissYan/article/details/116022740