Author Topic: Multiple Files in Single Project.  (Read 5424 times)

Offline hemu126

  • Single posting newcomer
  • *
  • Posts: 2
Multiple Files in Single Project.
« on: January 01, 2012, 06:04:14 am »
Can we create multiple C/C++ files in a single project in C::B? If Yes, how to run the file in the project?

I have created one project with 3 C++ Files, when i build the particular file i am getting Error: " Multiple definition of 'main' ".

I used breakpoint at main(), then also getting the same error.

Please help me how to run multiple files in a single project in C::B.

Thank You.




Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Multiple Files in Single Project.
« Reply #1 on: January 01, 2012, 11:05:12 am »
Can we create multiple C/C++ files in a single project in C::B? If Yes, how to run the file in the project?

I have created one project with 3 C++ Files, when i build the particular file i am getting Error: " Multiple definition of 'main' ".

I used breakpoint at main(), then also getting the same error.

Please help me how to run multiple files in a single project in C::B.

Thank You.

It's possible of course, otherwise we would not be able to develop C::B itself.

But you can not have multiple definitions of the main() function in one target (in the sources for one executable).

Offline hemu126

  • Single posting newcomer
  • *
  • Posts: 2
Re: Multiple Files in Single Project.
« Reply #2 on: January 01, 2012, 11:50:17 am »
Thanks for the reply.

I am new to C++ & C::B, can u please give me a example how to do it without multiple definitions of main() in one project.


Thank You.




Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Multiple Files in Single Project.
« Reply #3 on: January 01, 2012, 03:04:27 pm »
I just put you on my ignorelist for personal messages.

Please do not bother me or other users with general programming questions at all and don't ask questions that belong to the forum (and have been asked here in your case) in pm's, unless the user asked you to do so.

Be warned, you might get banned from the forum.