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.
12367 Discussions

How to use C++ with NIOS tools?

corestar
New Contributor I
178 Views

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
EricMunYew_C_Intel
Moderator
157 Views

Hi, David


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


Reply