Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

C++ on Microtronix uClinux distribution

Altera_Forum
Honored Contributor II
1,064 Views

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
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
305 Views

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
0 Kudos
Reply