Making a project without a main.cpp file ?

General questions regarding the usage of CodeLite
User avatar
Nosferax
CodeLite Enthusiast
Posts: 20
Joined: Fri Feb 05, 2010 4:59 am
Genuine User: Yes
IDE Question: C++
Contact:

Making a project without a main.cpp file ?

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post by eranif »

Did you renamed the main.cpp file into something else?
If you did, a "rebuild" will fix this

Eran
Make sure you have read the HOW TO POST thread
User avatar
Nosferax
CodeLite Enthusiast
Posts: 20
Joined: Fri Feb 05, 2010 4:59 am
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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.
Post Reply