After much trial and error I have found a solution to building a simple CPP project.
- Build the BSP as usual (I make sure to check the enable small lib and small drivers).
- Build a NIOS-II project based on the BSP.
- With the project selected, add a new file to the project. I used the "File from Template". Make sure it has the .cpp extension. Now you should have the file insterted in your project, but it will have no code inside.
- Open the file for editing and insert the standard main() function, I used:
extern "C"
{
#include <stdio.h>
#include "system.h"
}
int main(
void)
{
puts("Hello World!!!");
return 0;
}
Life is good again!:)