BUG: Dependency List in Makefile Incorrectly Generated
PSS ID Number: Q119278
Article last modified on 08-26-1994

1.00 1.50 | 1.10

WINDOWS   | WINDOWS NT


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft Visual C++ for Windows, versions 1.0 and 1.5
 - Microsoft Visual C++ for Windows NT, version 1.1
----------------------------------------------------------------------

SYMPTOMS
========

The header file that is included with a particular .CPP file in a project
may not be listed in the dependency macros in the project's makefile.

STATUS
======

Microsoft has confirmed this to be a bug with the Visual Workbench for
Windows, versions 1.0 and 1.5, and the Visual Workbench for Windows NT,
version 1.1. We are researching this problem and will post new information
here in the Microsoft Knowledge base as it becomes available.

MORE INFORMATION
================

To reproduce the problem, use the following files and open a new project
using the Visual Workbench. First add the file TESTERR1.CPP to the project,
then add TESTERR2.CPP to the project.

   // TESTERR1.CPP

      #include "testerr1.hpp"
      #include "testerr2.hpp"

   // TESTERR2.CPP

      #include "testerr2.hpp"

   // TESTERR1.HPP

      #ifndef __TESTERR1_HPP__
      #define __TESTERR1_HPP__
      #include "testerr3.hpp"
      #endif

   // TESTERR2.HPP

      #ifndef __TESTERR2_HPP__
      #define __TESTERR2_HPP__
      #include "testerr3.hpp"
      #endif

   // TESTERR3.HPP

      #ifndef __TESTERR3_HPP__
      #define __TESTERR3_HPP__
      #include "testerr4.hpp"
      #endif

   // TESTERR4.HPP

      int i;

The dependency macros created by the Visual Workbench, which are located in
the project's makefile (for example, TEST.MAK), are as follows:

   TESTERR1_DEP = C:\TEMP\TESTERR1.HPP \
         C:\TEMP\TESTERR3.HPP \
         C:\TEMP\TESTERR4.HPP \
         C:\TEMP\TESTERR2.HPP

   TESTERR2_DEP = C:\TEMP\TESTERR2.HPP \
         C:\TEMP\TESTERR3.HPP

The header file TESTERR4.HPP should be listed as part of the TESTERR2_DEP
macro, but it has been excluded.

To work around the problem, remove the two .CPP files from the project list
and add them again, but in the reverse order (that is, add TESTERR2.CPP
first and then TESTERR1.CPP). The dependency macros will then be correct
and will be set as follows:

   TESTERR2_DEP = C:\TEMP\TESTERR2.HPP \
         C:\TEMP\TESTERR3.HPP \
         C:\TEMP\TESTERR4.HPP

   TESTERR1_DEP = C:\TEMP\TESTERR1.HPP \
        C:\TEMP\TESTERR3.HPP \
        C:\TEMP\TESTERR4.HPP \
        C:\TEMP\TESTERR2.HPP

Additional reference words: 1.00 1.50 1.10
KBCategory: Tls
KBSubCategory: VWBIss

=============================================================================

Copyright Microsoft Corporation 1994.
