这个报错的出现一般常见于开启了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