Do you see this error even with Hello World example (before adding your code)?
I've tested your files and working fine until printing "Hello from Nios II"
Can you try this and see? If there is no error then we should run through the code and see. Maybe something went wrong.
else you can try the following (might help):
Right click the BSP project ... NIOS II... Edit BSP... check "Enable small C library"
Right click the project....properties....NIOS II application properties .... choose Debug Level "Level 2" .....Optimization Level "Level 2" .
Regards.