FIX: Conditional Directives Ignored by Dependency Scanning

Last reviewed: September 18, 1997
Article ID: Q116419
1.00 1.50 | 1.00
WINDOWS   | WINDOWS NT
kbtool kbfixlist kbbuglist

The information in this article applies to:

  • The Visual Workbench, included with:

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

SYMPTOMS

Conditional compilation directives (#if, #endif, and so forth), put in so that you can selectively include header files within a source file, are handled inconsistently by the .MAK file dependency generator when it writes the .MAK file for a project.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 2.0

MORE INFORMATION

The following steps can be used to reproduce this problem:

  1. Create the following two files (assume the files JUNK.H and \TMP\JUNK.H do not already exist):

            //---------------------
            // main.cpp
            //---------------------
            #undef SOMETHING
            #include "test.h"
    
            //---------------------
            // test.h
            //---------------------
            #if defined (SOMETHING)
            #include <junk.h>
            #include <\tmp\junk.h>
            #endif
    
    

  2. Create a new project for an MS-DOS or console application using the Visual WorkBench.

  3. Add MAIN.CPP to the project dependencies from the dialog box you get by choosing Edit from the Project menu.

  4. Open the .MAK file you created and look for the section describing the dependencies for MAIN.CPP. (In Visual C++, version 1.5, the Visual WorkBench creates a macro called MAIN_DEP to keep track of the dependencies.) Notice that there is a dependency on TEST.H (which is correct) and that there is no dependency on JUNK.H (which is also correct), but that there is a dependency on \TMP\JUNK.H (which is incorrect).


Additional reference words: 1.00 1.50 1.10
KBCategory: kbtool kbfixlist kbbuglist
KBSubcategory: VWBIss
Keywords : VwbIss kbbuglist kbfixlist kbtool
Version : 1.00 1.50 | 1.00
Platform : NT WINDOWS
Solution Type : kbfix


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: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.