Forum Discussion
Altera_Forum
Honored Contributor
21 years agoC++ Application
I was hoping someone out there is using Standard C++ on the Nios II. I can compile, link, and add to the filesystem the following code: # include <stdio.h> // hello_nios.cpp int main(int argc...
Altera_Forum
Honored Contributor
21 years agoYou 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;