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++
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.
12583 Discussions

How to use C++ with NIOS tools?

New Contributor I

I'm using Quartus 18.0 Std with the NIOS tools. I'm having a terrible time getting C++ to work in any sensible fashion. There appear to be all sorts of "quirks". Do you have to set some special setting to use C++?

One example, I have a function declared in a header as:

extern int ultoa(uint value, char *buffer, uint base = 10, bool sign = false);

If I attempt to use the function in a cpp file, it gives the error shown in the argument_error.jpg.

If comment out declaration of ultoa in the .h file and move it to the .cpp file, the error disappears. The code works correctly in both cases. I tried changing the .h file to .hpp to no avail.

Another quirk is if I use a .hpp extension for headers, it cannot find headers located in the BSP. But if I leave it as .h, it finds them fine. I prefer .h, but it does not seem to recognize C++ code.



0 Kudos
1 Reply

Hi, David

you can try enable_c_plus_plus in BSP under Main->Advanced.

0 Kudos