Forum Discussion
Altera_Forum
Honored Contributor
20 years agoC compiles, C++ doesn't
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_wor...
Altera_Forum
Honored Contributor
20 years agoInstead 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