Creating & Using A 
Visual C++ 2003
Project Workspace

powered by FreeFind

Modified: 

 

This document outlines the steps for creating and using a new Microsoft Visual C++ 2003 project from scratch. The project name here is lab1, use the name appropriate for your project.

The four basic steps are:

  1. Creating a New Project Solution
  2. Adding Source Code Files to the Project & Adding the Standard C++ Wrapper Classes
  3. Changing Project Settings
  4. Compiling the Project
Note: the following steps outline how to set up a project at home on your C:\ drive. If you are working at on campus, you must follow the same steps, except when typing in a path name, always substitute your removable drive for C:\

1. Creating a New Workspace

  1. From Windows, start up Microsoft Visual Studio .Net
  2. Choose File | New | Project ...
  3. The following steps are done from the New Project dialog:
  • 1st - Select Project Type
  • 2nd - Select Template
  • 3rd - Set Location
  • 4th - Enter Project Name (lab1 is OK)
  • 5th - Click OK

 

  • Note: if you are working on campus, then project location should be set to your removable drive such as: F:\BIGDEV
  1. The following steps are done from the 2nd page of the New Project dialog:

  • 1st - Choose Application Settings
  • 2nd - Choose the Application Type
  • 3rd - Choose Additional Options
  • 4th - Click Finish
  1. A new project solution has now been created. You now need to Add Files and change Project Settings.

2. Adding Source Code Files to the Project

2.1 Adding the Project's .CPP files to the Workspace

Any time after a Project Solution has been created, you may add source code files.
  1. Right click Source Files and choose Add | Add Existing Item ...
    • Add the desired .CPP files.
      For Project1, add all the .CPP files from the C:\BigDev\Project1 folder.  Do not add .HPP files, only .CPP files.
  2. Right click Header Files and choose Add | Add Existing Item ...
    • Add the desired .HPP files.
      For Project1, add all the .HPP files from the C:\BigDev\Project1 folder.

2.2 Creating a Wrapper Folder for holding C++ Wrapper Classes Types

After a project has been created, you must add a folder to the project Files list.   The folder will initially be empty, however, you will then add .CPP files for the Standard C++ Wrapper Classes (Boolean, Character, File, Integer, Long, and Text). You must do this only once for each project you create, and you must add these before trying to compile your project.

  1. Right click Source Files and choose Add | New Folder ... Newfold.gif (1049 bytes)
  2. Name the new folder wrapper
  3. Right click the wrapper folder and choose Add | Add Existing Item ...
    We're going to add files to the wrapper folder.
  1. From the "Add Existing Item" dialog you must navigate to the C:\BigDev\WRAPPER\CLASS folder (see screen shot to right).

 

  1. Select all the .CPP files that appear in the C:\BigDev\WRAPPER\CLASS folder, then click OK

 

2.3 When you are finished

Your project solution window should look similar to the screen shot to the right:

3. Changing Project Settings

Each time a new project is created, you must change its specific settings. You only need to do this once. Failure to successfully change the settings will usually cause millions of compiler errors to be generated.

To change a project's settings, do the following:
Right click lab1 (or whatever you called your project) and choose Properties, the "Properties Pages" dialog will appear.
  1. Choose All Configurations from the drop down box at the top of the dialog
  2. Select the C/C++ folder, and then select the General category
  3. Then on the right hand side of the dialog add the following path names to Additional Include Directories:

    ..\wrapper\include;..\cmpnts\include

    Note this assumes wrapper and cmpnts are siblings of lab1 directory. If not, you will get many compile errors and need to correct the paths.

  4. Finally, select Precompiled Headers category 
    • then on the right side select from the following from the Create/Use Precompiled Header drop down box:
      Not Using Precompiled Headers

4. Compiling the Project

After creating a new project solution, adding files, and changing settings, you are now ready to compile.
  • To compile one .CPP file at a time
    • From the Solution Explorer window right click on the file that needs compiling, choose "Compile" from the quick menu.
    • In the screen shot to the right, the right click was on the Driver.cpp file.