Author Topic: Multiple files with main() in a project?  (Read 3258 times)

malaywang

  • Guest
Multiple files with main() in a project?
« 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.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Multiple files with main() in a project?
« Reply #1 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.

malaywang

  • Guest
Re: Multiple files with main() in a project?
« Reply #2 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)