hello again.
as I told you. you need to know a lot of things.
like Daixiwen says, your code is not for all platform.
I don't think your code can't run on your FPGA ( at least for now)
you have to do ...
1. run NiosII software on your FPGA.
kaushal says run your simple code like "hello world" on your FPGA.
you have to do this.
2.you have to know who does that.
you know, Operating Systems help lots of things.
like saving files, connecting Networks and so on.
to use those power, there is a lot of libraries. you see C-kind languages like# include <stdio.h>
when you open file, Operating System does most of work.
the other hand, NiosII does not have OS as long as you install one.(<- this is tough work )
so, many of your include files ( like memory.h) does not work on your FPGA.
my advice is that.
you need to read each file which gives errors. and modify it for you NiosII.
or
installing OS like uClinux on your NiosII. your C++ code may work on your OS.
both of them are a lot of work (I told you.)
you need guru beside with you.
if you are student, you have to ask teacher or geek friend ( there must be one lol.)
if you work in an office, find skilled parson.
if you work alone, take much time.
actually I want help you.
but, what we can teach on this page is to solve small problem one by one.
not tell whole your work.
your problem is not solved just one action.