Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

integrating c++ files into NIOS II

Altera_Forum
Honored Contributor II
992 Views

Hello! 

 

I would like to know if there is the possibility to add C++ files into a NIOS II C project and how I could do that, because the information I have seen so far is not that clear. 

 

BTW, when I added a cpp file to my project but the system generates an *.elf file error when compiling... 

 

Thank you very much in advance for your support!!!!
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
109 Views

You are probably 'just' missing a lot of the C++ runtime library. 

While it is probably technically possible to build all the relevant library routines, personally I think you'll find that the code ends up too large and slow to do anything useful.
Altera_Forum
Honored Contributor II
109 Views

Thank you for your answer!!!! 

 

I will then look at the libraries and try it again. Ah, I will keep in mind what you say regarding the extension of the code when mixing C and C++.
Altera_Forum
Honored Contributor II
109 Views

While a small subset of C++ might be useful in an embedded system (simple inheritace), but the sheer amount of code generated for templates, exceptions and stream io will cause issues, never mind problems with heap space. 

 

Rather like the fact that you CAN run linux on the nios (with external DDR memory), doesn't necessarily mean that it is a good idea to do so - unless your processing requirements are limited and you have fpga resources going to waste. 

(Someone will probably shout me down on that one!)
Reply