Code::Blocks Forums

User forums => Help => Topic started by: malaywang on November 25, 2005, 07:37:57 am

Title: Multiple files with main() in a project?
Post by: malaywang on November 25, 2005, 07:37:57 am
My problem is:
I have many files in a project, and some of them have main() defined  inside.
When I build the project, the compiler complains about multiple main() definitions...

Can I choose the main() to run in a project??
For example, I can choose the class with main() to run in a project under Jbuilder enviroment.

Thx for your great help.
Title: Re: Multiple files with main() in a project?
Post by: rickg22 on November 25, 2005, 08:16:11 am
That's what targets are for. A file can belong to multiple targets. A target can be an exe, a dll, a lib, etc.
Title: Re: Multiple files with main() in a project?
Post by: malaywang on November 25, 2005, 08:44:52 am
Thanks a lot   :D
Now I figure out how it works.
(Migrating my files to C::B now  :) thx)