Separate compilation using the:

 Visual C++ Development Environment

 

 

  1. Select File | New from the Visual C++ toolbar. Make sure the projects tab is selected.
  2. Select Win32 Console Application.
  3. Type in the name of your project.
  4. Select O.K.

 

 

Visual C++ creates the workspace of your application. It actually creates a Directory named after your project name (step 3), which enables you to store all files related to a particular project in one area.

 

Adding files to your project:

 

  1. Once again, Select File | New from the Visual C++ toolbar.
  2. Select the Files tab if not already selected.
  3. Highlight C++ source file if you want to add C/C++ source file or highlight header file if you want to add a header file to your project.
  4. Check the add to project box on the right side.
  5. Type in the file name (the suffix will be given automatically).
  6. Click O.K

 

 

Repeat steps 5-10 to add as many files as you want to your project.

 

 

     Compiling and linking the project files:

 

  1. Select File | Save all to save all your files.
  2. Select Build | Compile “filename.cpp” or Ctrl+F7 or press the compile button on the toolbar to compile each one of your files.
  3. After all files are compiled select Build | Build “filename.exe” or press F7 or press the build button on the toolbar, to link all your files and to generate the executable.

 

 

You can now run your program/project by selecting build | execute or pressing the ! button on the toolbar.