Page 1 of 1

Making a project without a main.cpp file ?

Posted: Fri Feb 05, 2010 11:00 pm
by Nosferax
Hi,

I can't make a project without a main.cpp file... Say I wanted to put the main function in a different file called project.cpp ... I get the following error

Code: Select all

 *** No rule to make target `main.cpp', needed by `Debug/main.o'.  Stop.
Is it bad practice to put the main function in a different file? Is there a way around this?

Thanks!
Nox

Re: Making a project without a main.cpp file ?

Posted: Sat Feb 06, 2010 4:58 am
by eranif
Did you renamed the main.cpp file into something else?
If you did, a "rebuild" will fix this

Eran

Re: Making a project without a main.cpp file ?

Posted: Sun Feb 07, 2010 11:27 pm
by Nosferax
Toying a bit with the files got me around this.

But at first, no I didn't rename the file main.cpp to notmain.cpp. I simply erased main.cpp and added premade files into the directory. Once I renamed notmain.cpp back to main.cpp and then back to notmain.cpp it worked.