You might run into an error like
In function `__gnu_cxx::__verbose_terminate_handler()':
/build/nios2/bin/nios2-gnutools/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:68:
undefined reference to `_impure_ptr'
The reason for this error is that libsupc++ from the toolchain was built with newlib header files, which define stderr as _impure_ptr->stderr. A possible workaround is to put a dummy _impure_ptr somewhere in the application:
#include <stdio.h>
struct __myreent
{
int _errno;
FILE *_stdin, *_stdout, *_stderr;
};
static struct __myreent __myblock = {
0, stdin, stdout, stderr
};
struct __myreent *_impure_ptr=&__myblock;