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++

C compiles, C++ doesn't

Altera_Forum
Honored Contributor II
1,199 Views

I'm running the Nios II IDE in Windows. I can compile and run the supplied "Hello, world". If I change the file extension to .cpp or .cxx, I get: 

*** no rule to make target `../hello_world.c', needed by `obj/hello_world.o' 

 

If I change the extension from .c to .c, I get a dialogue box with: 

no valid design files found. project hello_world_0 must contain design files 

and the "detailed" explanation reads: 

no valid design files found. project hello_world_0 must contain design files 

 

Any ideas? I don't need the compilation type to be automatic, so it's OK either to fix this fault or force it to compile for C++.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
489 Views

Instead of renaming the file try adding a new file (e.g. test.cpp). Add some C++ code to make sure it really compiles as C++. Then get rid of hello_world.c and add the main() function to your new C++ file. 

 

I think the problem is that once a rule for hello_world.o has been established it's linked to hello_world.c. You may be able to add hello_world.cpp back in after deleting hello_world.c but it's not likely you even want a source file with that name. 

 

Andrew
0 Kudos
Altera_Forum
Honored Contributor II
489 Views

Thanks, Andrew. That seems to be the explanation. 

 

Already I have a bad feeling about this IDE. If something like this fails, there will be trouble ahead.
0 Kudos
Reply