Languages::C++::Visual Studio::Second Project

PIC Lab



Your second homework: Working with multiple projects

This section is intended to be a tutorial for PIC10A students on how to set up your second homework assignment and subsequent assignments.

READ THIS: As in setting up your first homework, there are quite a few steps you must go through just to get started. Try to follow every step; Visual Studio is very picky, so if you miss one thing, you will probably run into errors. If you follow the steps, you will have no problem getting set up. If you have any questions, don't hesitate to ask a Lab Assistant.

  1. Getting back to where you left off

    When you finished your first homework, you had one project inside one solution. For your second and subsequent homeworks, you will be adding a project for each assignment.
    1. Open Microsoft Visual Studio: click Start->Programs->Microsoft Visual Studio .NET 2003->Microsoft Visual Studio .NET 2003
    2. Click on File->Open Solution...
    3. In the "Open Solution" window that pops up, locate your Z: drive in the "Look in" drop down box.
    4. If you set up everything as in the previous tutorial, you should see a folder named PIC10A or something similar. Double-click on this folder.
    5. Inside the folder, you should see a file named "PIC10A.sln" or something similar. Double click on this file.
    6. Visual Studio will open up the solution for you, and you will be where you left off on your first homework.
  2. Adding another project

    You will now add a project in which to put your .cpp files for your second homework. You must go through a few steps to ensure that you work on only the new homework, not the old one.
    1. Add a new project to the current solution: In the "Solution Explorer" panel in the upper right, right click on "Solution 'PIC10A' (1 project)".
    2. Select Add->New Project...
    3. Create a new project as described in steps 3-9 of the previous tutorial.
    4. Visual Studio has the notion of a "Startup Project." This is basically your current working project. When you hit the "Start without Debugging" button to run your program, you are running the program corresponding to your Startup Project. In the Solution Explorer pane, the Startup Project has its name in boldface font; the other projects are in standard font face. You must make the project you want to work on be the Startup Project.
    5. Right click on the project you just created in the Solution Explorer pane.
    6. Select "Set as StartUp Project." The project will now have its name displayed in boldface font.
    7. Now click on Tools->Options in the main menus.
    8. On the left, under the "Environment" folder, click on "Projects and Solutions".
    9. On the right, under "Build and Run Options," make sure the "Only build startup projects and dependencies on Run" box is checked.
    10. Click "OK" to close the "Options" window.
    11. One final thing: you must now add files to your project to begin typing in your code. Please refer to section 3 , "Adding files to your project," of the previous tutorial; the steps for adding files are the same for your second and subsequent homeworks.
    You will need to repeat these steps for each of your subsequent homeowork assignments. Don't despair; it does get easier.

Last updated by Nick Keller.


Feedback
PIC Lab home
up one level
UCLA Department of Mathematics
Program in Computing - PIC Lab
2817 Boelter Hall / 310-825-7267
This page last updated: April 13, 2004