locked
Multiple main methods RRS feed

  • Question

  • I am currently in my first year at university studying Computer Science. As part of one of our modules we have to do some C programming using visual C++ At the moment we are making a lot of very small basic programs just to understand the core concepts. I have heard that i can stick all of these programs into one project and then tell the debugger which one to compile and execute. However, i can not figure out how to do this. Can anyone help?

    Many Thanks.
    Monday, February 9, 2009 9:10 PM

Answers

  • No, you are better off sticking multiple projects in the same solution.You can build them all, or any one of them individually.
    • Marked as answer by Nancy Shao Monday, February 16, 2009 12:57 AM
    Monday, February 9, 2009 9:23 PM
  • I would start by creating an empty solution. Doing that might be a bit tricky; I think you want to create a project then for "Project types" choose "Other Project Types" then "Visual Studio Solutions" then in the right side you will see "Blank Solution". Then you can create projects and be sure to choose "Add to Solution" instead of "Create Solution". When creating projects, I never use the "Create Directory for Solution" checkbox (uncheck it).

    There are a few detials about doing that and I hope you can figure it all out. For example, I try to ensure that all projects in a solution are subdirectories of the solution, but explaining that will take too much time.

    Sam Hobbs; see my SimpleSamples.Info
    • Marked as answer by Nancy Shao Monday, February 16, 2009 12:57 AM
    Wednesday, February 11, 2009 9:16 AM

All replies

  • No, you are better off sticking multiple projects in the same solution.You can build them all, or any one of them individually.
    • Marked as answer by Nancy Shao Monday, February 16, 2009 12:57 AM
    Monday, February 9, 2009 9:23 PM
  • how do i go about doing this?
    Monday, February 9, 2009 9:31 PM
  • Right-click over the solution in the Solution Explorer panel, Add, New Project...

    Monday, February 9, 2009 10:21 PM
  • I would start by creating an empty solution. Doing that might be a bit tricky; I think you want to create a project then for "Project types" choose "Other Project Types" then "Visual Studio Solutions" then in the right side you will see "Blank Solution". Then you can create projects and be sure to choose "Add to Solution" instead of "Create Solution". When creating projects, I never use the "Create Directory for Solution" checkbox (uncheck it).

    There are a few detials about doing that and I hope you can figure it all out. For example, I try to ensure that all projects in a solution are subdirectories of the solution, but explaining that will take too much time.

    Sam Hobbs; see my SimpleSamples.Info
    • Marked as answer by Nancy Shao Monday, February 16, 2009 12:57 AM
    Wednesday, February 11, 2009 9:16 AM