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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

C++ classes...

Altera_Forum
Honored Contributor II
1,591 Views

Hey Guys, 

 

is it possible to do object oriented programming in NIOSII? 

 

when I define a simple class in a .h or .hpp file, I get syntax 

errors all over the place.... 

 

I even get errors for using the word "class"... 

 

can someone please provide some insight into whether it is 

even possible to program C++ in NIOSII? 

 

thanks, 

Aydin.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
498 Views

I have not had any problems. I just rename the file created by the new application wizard from a .c to a .cpp file (hello_world.c or whatever) and it works fine.

0 Kudos
Altera_Forum
Honored Contributor II
498 Views

Hi, 

 

That is not the problem... I am having trouble declaring my own classes... 

 

I want to be able to declare a really simple class... 

 

however, in order to declare a class, I need to include iostream 

and this I cannot do properly.... 

 

if there is anyone out there that has been able to run a very simple 

c++ program, please please explain how you can include iostream...# include <iostream> 

does not work...  

 

thanks, 

aydin_y_mirzaee@yahoo.com
0 Kudos
Altera_Forum
Honored Contributor II
498 Views

 

--- Quote Start ---  

originally posted by aym35@Nov 15 2005, 04:36 PM 

hey guys, 

 

is it possible to do object oriented programming in niosii? 

 

when i define a simple class in a .h or .hpp file, i get syntax 

errors all over the place.... 

 

i even get errors for using the word "class"... 

 

can someone please provide some insight into whether it is 

even possible to program c++ in niosii? 

 

thanks, 

aydin. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11002) 

--- quote end ---  

 

--- Quote End ---  

 

I noticed the compiler behaves different if the file extention is ".c" instead of ".cpp". 

I had trouble wheni included a header containing cpp in a normal c file.  

Otherwise cpp works fine. 

 

Karsten
0 Kudos
Altera_Forum
Honored Contributor II
498 Views

Similarly, the compiler will treat ".c" and ".C" differently. 

 

-Joel- 

 

 

I noticed the compiler behaves different if the file extention is ".c" instead of ".cpp". 

I had trouble wheni included a header containing cpp in a normal c file.  

Otherwise cpp works fine. 

 

Karsten
0 Kudos
Reply