Creating a Project with Multiple Directories

Last reviewed: January 21, 1996
Article ID: Q83229
The information in this article applies to:
  • The Visual Workbench included with:

        - Microsoft Visual C++ for Windows, version 1.0 and 1.5
        - Microsoft Visual C++ 32-bit Edition, version 1.0
    

SUMMARY

To help manage a large software project, it is often desirable to store source code and object modules in different directories. By default, Visual Workbench and QuickC for Windows stores the source code and object modules in the same directory. However, you can segregate the source code and object modules by creating the project file in the directory that will contain the object modules.

MORE INFORMATION

To maintain a project with multiple directories, first build the desired directory structure. For example, consider the following directory structure:

   Main project directory: \TEST
   Source code:            \TEST\SOURCE
   Object files:           \TEST\OBJ

If desired, you can create additional directories (to store header files, and so on). The results of the compilation (.OBJ, .DLL, .EXE, and other files) are placed into the project directory. You cannot place the .OBJ and .EXE files into different directories. In this example, all source files are placed into the source code directory.

Perform the following steps to use the directory structure above:

  1. Create the source files in the source code directory.

  2. From the Project menu, choose Open.

  3. Type the name of your project file (for example, TEST.MAK) in the File Name edit control.

  4. In the Directories list box, choose the object files directory.

  5. Choose OK to create a new project. This creates the project file in the object files directory. When you build the project, the tools store all build results in this directory.

  6. In the Edit Project dialog box, choose the project files from the source directory to add them to the project list. Include all .C, .H, .DEF, .RC, .CUR, .DLG, and other files required to build your project.

  7. Build the project.

NOTE: This kind of technique is not recommended for AppWizard generated projects because Class Wizard (.CLW) files will be required in the OBJ and SOURCE directories.


Additional reference words: kbinf 1.00 1.10 1.50 1.51 1.52 build obj
KBCategory: kbtool
KBSubcategory: VWBIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 21, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.