I fixed my first problem, which also fixed the compilation errors as suspected, by doing this:
I have a two drive laptop. My program files were on the C: drive and my design files were on the D: drive.
I tried putting the design files on the C:drive in the Documents folder, instead of on the D: drive and now it seems to correctly generate both the projects in the NiosII IDE correctly. It also compiles without errors now too. So it does seem like it is some kind of naming issue.
However now I have another problem. I download the .sof file to the FPGA from Quartus II, and when I build the project in the NIOS II system all is fine. However if I go to run the system as NiosII hardware I get the following message:
[Target Connection]: No Nios II target connection paths were located. Check connections and that a Nios II .sof is downloaded.
Searching the forums, I tried downloading the .elf file manually from the Nios Shell and it worked fine, no problems at all and the LEDs are counting along with the shell JTAG UART output.
Any ideas why the interface is not detecting the connection? It does seem to find the connection when I bring up the System Console window. It would be much simpler to download using the interface than having to constantly switch to the shell.