Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/102390

From BetaArchive Wiki
Knowledge Base


INFO: Keeping #include Files Out of VWB Dependency List

Article ID: 102390

Article Last Modified on 12/1/2003



APPLIES TO

  • Microsoft Visual C++ 1.0 Professional Edition
  • Microsoft Visual C++ 1.5 Professional Edition
  • Microsoft Visual C++ 1.52 Professional Edition
  • Microsoft Visual C++ 1.0 Professional Edition
  • Microsoft Visual C++ 2.0 Professional Edition
  • Microsoft Visual C++ 2.1
  • Microsoft Visual C++ 4.0 Standard Edition
  • Microsoft Visual C++ 4.1 Subscription
  • Microsoft Visual C++ 4.2 Professional Edition
  • Microsoft Visual C++ 5.0 Standard Edition



This article was previously published under Q102390



SUMMARY

By default, the Visual Workbench includes files in the dependency list even if they are included between an #ifdef, #endif pair. In some situations, this behavior may be undesirable. The following article describes several ways to keep the files out of the dependency scanning process.

MORE INFORMATION

The Visual Workbench scans a file for header file dependencies by looking for lines in a source file that have the form

   #include <filename.h>
                

-or-

   #include "filename.h"
                

Because the dependency scanner does not have a preprocessor, it will include headers file in the dependency list even if they conditionally included using an #ifdef as shown below.

For example, with the following code, the file "unixstuf.h" will be tagged as a dependency when the makefile is built:

   #define _WIN32
   #ifndef _WIN32
   #include <sys/unixstuf.h>
   #endif
                

To get the desired behavior:

Add the file name to the Visual C++ system header exclusion file, SYSINCL.DAT, found in the product BIN directory. The SYSINCL.DAT file is used by the Visual Workbench to prevent scanning specified files for dependencies. In its initial state, SYSINCL.DAT lists the system include files that are unlikely to change. You can edit this file to prevent the Visual Workbench from scanning other files, such as header files that you know will not change, or to scan system files that you alter. If you delete the SYSINCL.DAT file, Visual Workbench restores it to its default state the next time you start Visual Workbench.

For Visual C++ 32-bit Edition, you have the option of creating MSVCINCL.DAT in the Windows NT directory. As the Visual C++ 4.0 Books Online state in the entry for "Updating Dependencies":

You can list in [MSVCINCL.DAT] additional files that you want to exclude, such as headers for external class libraries or some of the include files in a large project. You should use this file for additions because SYSINCL.DAT may be overwritten if you reinstall Visual C++, if you modify your installation with Setup, or if you update your installation. . . . These lists should contain only files that are not likely to change often.


Make any necessary changes to SYSINCL.DAT or MSVCINCL.DAT before you start the Visual Workbench.

REFERENCES

For more information about SYSINCL.DAT with Visual C++ for Windows or Visual C++ 32-bit Edition, versions 1.0 and 2.x, choose Visual Workbench from the Visual Workbench Help menu and choose Search. Type "SYSINCL.DAT" and choose OK. For more information about SYSINCL.DAT or MSVCINCL.DAT with Visual C++ 32-bit Edition, version 4.0, search the Books Online for "updating dependencies".

NOTE: Each filename in these files must have a newline character sequence immediately following the last character of the filename. The newline character sequence is inserted by simply positioning the input cursor and pressing the <enter> key.

Keywords: kbinfo kbide KB102390