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++
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

Odd NIOS C++ compiler behaviour

New Contributor I

I'm using Quartus 18.0 Std and the NIOS SBT for eclipse. I have a header file called util.hpp which should be treated as C++. But all C++ code in the header is flagged as a compiler error as in cpp_error1.jpg.

I decided to add an #ifdef __cplusplus fully expecting that section of code to gray out. Instead it now compiles as in cpp_error2.jpg.

I'm not sure what is going on here. The #ifdef seems to be causing to compile as C++ instead of just checking if it is C++.

Note, C++ code in a .cpp file in the same project compiles just fine. Also, showing the properties of the util.hpp shows it to be C++.


0 Kudos
1 Reply

Hi, David

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