Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

C++ on Microtronix uClinux distribution

I have purchased uClinux from Microtronix for the nios2. It's up and running and I can build C applications and run them on a Cyclone board. I have not been able to build a clean C++ hello world program:

# include "iostream"

using namespace std;

int main()

{

cout << "Hello World";

}

Microtronix supplies header files and libraries to be used in place of those supplied by Altera. For C, this works fine. When I attempt to build the above, I get "undefined reference to `_impure_ptr&#39; " which looks like a mismatch between the Altera header files that# include "iostream" pulls in and the libraries from Microtronix. The command under Cygwin:

nios2-elf-g++

-msys-crt0=C:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/lib/crt0.o -r -LC

:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/lib -lstdc++ -lgcc -lc

-o hello.bin helloCpp.cpp

Has anyone had success with C++ on the Microtronix nios2 uClinux distribution?

Thanks,

Bruce

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    I get the same error with the eCos distribution for Nios II. If anyone can suggest

    a solution to this problem, it would be greatly appreciated. I have already posted

    to the "General Software Forum" regarding this issue. The topic title was

    "Iostream Problem".

    Thanks,

    Rennie