Separate compilation using the:
Visual C++
Development Environment
- Select File | New from the Visual C++ toolbar.
Make sure the projects tab is selected.
- Select Win32 Console Application.
- Type in the name of your project.
- 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:
- Once again, Select File | New from the Visual
C++ toolbar.
- Select the Files tab if not already selected.
- 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.
- Check the add to project box on the right side.
- Type in the file name (the suffix will be given
automatically).
- Click O.K
Repeat steps 5-10 to add as
many files as you want to your project.
Compiling
and linking the project files:
- Select
File | Save all to save all your files.
- Select
Build | Compile “filename.cpp” or Ctrl+F7 or press the
compile button on the toolbar to compile each one of your files.
- 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.