When I use the assert macro in my program I get an undefined reference to '__assert' error message when linking. Why is this?
The __assert function is an error handler function that is invoked when an assertion fails.
If you are writing a program that uses the assert macro then you must supply you own __assert error handler function. For example:
void
__assert(const char *error, const char *file, int line)
{
while (1);
}
Comments
0 comments
Please sign in to leave a comment.